Possible to get accurate position?

I wanted to know if I could get the relative position of one Arduino, to another, accurately, or if it was possible with just a gyroscope and accelerometers. I was thinking of an idea where a stylus like object could revolutionize several things. It'd basically be like a Wii remote, but I had several ideas with it. Creating an API to allow people to come up with creative ideas (some of the ones I came up with were Wii-style games, converting any screen into a smart screen etc.). It'd be a fun project for me and anyone else who wants to try it out and maybe it could be the future ;).
I'd appreciate any help, thanks!

Read about UWB (ultra Wide Band). It is still a research area and requires significant computing power and probably budget. Apple created a UWB chip (the U1) that is included in its devices so that they become aware of other apple devices around them - it’s used for example in prioritizing the device you point at in the target list for transmitting data wirelessly between devices (airdrop).

There was a few mention in the forum about UWB, here is one (not a specific recommendation, just first hit)

Please define "accurately". Currently, the only usable options are GPS for outdoors, video cameras with image processing or Pozyx for indoors. https://pozyx.io/

Can't be done with a gyroscope or accelerometers or both.

With a way to wirelessly trigger an ultrasonic ping (from a cheap HC-SRO4 ultrasonic rangefinder), It is possible to measure the distance from the sender to multiple receivers. That, and a little trigonometry, will give you the 3D location of the sender.

In theory. Can you post a link to a successful and convincing demonstration, using Arduino?

Given that this topic has come up on the forum at least once a week, for years, I've never seen anyone report a successful attempt.

In episode 38 of "The Ben Heck Show", Ben Heckendorn made a robot suitcase that followed an ultrasonic pinger on his belt. The Arduino in the suitcase would use an OOK RF transmitter to trigger the ultrasonic pinger and use two receivers on the suitcase to measure distances, from which he derived direction. He only needed 2D direction so only used two receivers. Use 3 or more for 3D.
https://www.element14.com/community/docs/DOC-43658/l/episode-38-see-ben-build-an-autonomous-robot-luggage

Note: The OOK RF transmitter and receiver are necessary because the receivers need to know exactly when the transmitter started transmitting.

IIRC, I saw such a device years ago used for navigation, when doing a tour of a retired submarine. I think it must have been a nuclear boat or they would have used more conventional means to get a fix when they surfaced.

How accurate it was or whether such things are still in use are no doubt still classified. With Arduino budgets though, I rather doubt you can get usable numbers that way.