#Minecraft's Triangulation - Filtering Two circle's Intersections based on Yaw

77 messages · Page 1 of 1 (latest)

vocal frost
#

What we have:
Eye 1: X, Z, YAW
Eye 2: X, Z, YAW

Using trigonometry and circles I'm getting intersection points but how do I filter which one is correct?
I'm using desmos regression and it sometimes chooses the wrong intersection.
AIs told me to use dot product, but that isn't working for me. I'm confused if is it even possible to filter out the correct intersection only using YAW and coords.

steel ivyBOT
#

Minecraft's Triangulation - Filtering Two circle's Intersections based on Yaw

full schooner
#

There is a bunch of ways to solve this. You could construct a triangle using the known angles and positions, like the Greeks would've done.
Or you could set up parametric line equations and solve for the point of intersection. That would probably be easier, if you're familiar with high school geometry.

#

For the second method, your position vectors are obviously the two points of observation, and the direction vectors are just [cos(θ), sin(θ)] where θ is the angle from the eastern direction, counter-clockwise.

#
analog fog
#

damn

vocal frost
timber jay
#

Minecraft can't be this serious wtf 😭 🙏

full schooner
full schooner
timber jay
vocal frost
vocal frost
full schooner
vocal frost
full schooner
#

Besides, lines cannot intersect on exactly 2 points.

full schooner
vocal frost
#

we've done parametric line equations on a very basic level in A-levels. From origin with no angles involved.

#

I'm trying to find a video or resource where I can learn exactly this.

#

i would read the ones you linked first

full schooner
# vocal frost we've done parametric line equations on a very basic level in A-levels. From ori...

I'll explain to you in detail how to approach this, using the provided material.

First off, the vector (parametric) equation of a line is this, using the notation from the article:

$\newline\overrightarrow{r}\ (t) = \overrightarrow{r_0} + t \cdot \overrightarrow{v}\newline$

Now $\overrightarrow{r}\ (t)$ returns a vector as a function of time. As $t$ varies, $\overrightarrow{r}\ (t)$ will return a vector pointing to every point of the line.

$\newline\overrightarrow{r_0}$ is the position vector. It points to one fixed point on the line.

$\newline\overrightarrow{v}$ is the direction vector. By plugging in different $t$ into the line equation, you are adding the direction vector scaled by the $t$'s to the position vector. That means that you are moving along the line that runs through the point pointed to by $\overrightarrow{r_0}$ in the direction of $\overrightarrow{v}$.

Now for your problem, we have two lines that each go from your position to the direction you are facing in the XZ-plane. The position vector of each line is just your position in the plane, because you know that the line must run through that point.

1/2

frozen orbitBOT
#

solarunes

full schooner
#

The direction vector is given by the argument, an angle, which has to do with the "yaw angle" you are concerned about.

Think about how sine and cosine are defined in the unit circle for a second. As you move along the arc of the unit circle in counter-clockwise direction, starting from (1,0), the cosine and sine of the angle by which you have moved are just the x and y coordinates of your position.
I added an image for reference to illustrate this, in case you need it.

Let's say the "yaw angle" you are given is also 0 at (1,0), so it behaves exactly like the argument in polar coordinates. If this is not the case (perhaps the angle you are working with is 0 at (0,1) or somewhere else), you will just have to offset the angle by the difference.
Now, given the polar argument θ, we can find a vector pointing in the direction of θ by using the definition of the sine and cosine functions: By looking at the image above, this will just be [cos(θ), sin(θ)]. And that is our direction vector, v. Notice how the length of the vector doesn't really matter here, since it is scaled by t arbitrarily in the line equation.

To find the point of intersection, simply set the two line equations you calculated equal and solve for the parameter of one of them. Then plug the parameter into the line equation. You will get a vector pointing to the point where both line equations hold, meaning that the point is on both lines, thus is their intersection. You will not get a solution if the lines are parallel, or infinitely manny if they are overlapping.

2/2

#

This video gives an introduction to how we use the unit circle to define sine and cosine for angles greater than 90 degrees. This is just a conceptual discussion, and I don't go over any problems just yet. The main ideas are:

  1. For every angle θ, the point on the unit circle is (cos θ, sin θ).
  2. We can draw triangles to find out exactly wh...
▶ Play video
#

Sorry, just wanted to add a reference to the image. You probably don't need to watch that video.

vocal frost
# frozen orbit **solarunes**

What I've understood:

  1. t-or lambda (which we commonly used in A-Levels)-is the variable which would give us any point on that line
  2. v is the direction vector which we will form using our YAW: (-sin(YAW), cos(YAW))-so now direction is involved here.
  3. after creating these equations with the given information, we have two such equations and we have to find that t or lambda which is the only intersection point now that we have involved direction.

Now it makes total sense to me how direction is involved, thanks to your explanation!

#

And maybe we would plug the t-or lambda-in any equation and get x or y? if i'm not wrong...

full schooner
full schooner
vocal frost
#

i even checked it rn and it is working?

#

are you asking me about this or something else?

full schooner
#

So I'll assume you're just doing that. If it works, that's great.

vocal frost
#

well I think I got it, if my X is in negative I just use -sinx.
if my Z/Y is in negative i use -cos.
simple?

full schooner
full schooner
full schooner
#

If you want to measure some angles from the axis pointing "down", perhaps negative Z/Y, you'd again have to account for the new offset:

v = [cos(θ + 270°), sin(θ + 270°)] = [sin(θ), -cos(θ)]

This is what you meant as well, right?

vocal frost
full schooner
vocal frost
#

well, Now I've to combine all what I've learned and get back to you once I'm done!
thanks for all of this! I had been struggling for hours yesterday.
also are you a maths major?

iron moon
vocal frost
# iron moon What do the circles represent?

well using trig, we have got how many blocks away the stronghold is. But we don't know it's exact location. So, I created two circles from the two locations where we threw those Eye of enders previously. The intersection of that would be the stronghold.

iron moon
#

Wouldn't they be lines tho?

#

Eyes of ender show direction not distance

vocal frost
#

I calculated distance. Well, i got intrigued by a video which was only showing how trig is used to know how many blocks away the stronghold is. However, i wanted to know the exact location so I did further calculations and end up mixing alot of things

iron moon
#

How do you get distance?

#

Without getting the exact location first, I mean

vocal frost
#

distance of what exactly? the stronghold, right?

iron moon
#

Yeah

vocal frost
#

Using trigonometry, if you've played minecraft before, It shows angle-or YAW-and coordinates, then you move 90 degrees and run straight from there some blocks, you throw eye of ender again and look at it, you list the coordinates and the angle again and from there we get a right angle triangle.
using the two points we get the distance of them which is our base of the triangle and the difference of angles is our angle of the right triangle.

iron moon
#

Do you first look at the eye of ender?

iron moon
#

Ok

#

Yeah then take the tangent of the difference of the yaws and multiply by distance between the two thrown pearls to get the distance from the first point to the stronghold

#

You then just multiply by the unit vector in the direction of the first pearl and add to the position of the first pearl when it was thrown

vocal frost
iron moon
#

You can't get y, but you can get x and z

iron moon
vocal frost
#

I think the easiest solution is the one which solarunes explained me which is through vector equation of line

iron moon
timber jay
vocal frost
#

there is no way it worked!
without simultaneously solving any equations.

vocal frost
#

@full schooner Thanks for you help! I did it!

#

now how do i close this post

vocal frost
#

.solved

steel ivyBOT
#
Solved

Post marked as solved by @vocal frost.

Use .unsolved if this was a mistake.

vocal frost
#

.close