Results 1 to 9 of 9

Math Help - Position of an observer of a square

  1. #1
    Newbie
    Joined
    Jan 2008
    Posts
    6

    Position of an observer of a square

    Hi all,
    during some hobby research I encountered a geometrical problem I can't solve for my knowledge. I hope you can give me some help:

    I have a square which I know the edge length (1); then I have a point, outside of it, and segments that connect it to each square's vertex. I know the angles between each segment and the next.
    I need to know the length of at least two segments, and/or the coordinates of the observer if we place all them in a Cartesian plane.

    This is needed for me for a sort of "perspective identification": i need to know the observer's orientation (yaw/pitch/roll) and distance w.r.t. to the reference square. Only when the above problem is solved, I think I can easily adapt it into 3D. But if you have good solution for this "bigger" problem too, feel free to inform me

    Many many many thanks!!! and greetings from Italy!

    Enrico
    Follow Math Help Forum on Facebook and Google+

  2. #2
    Flow Master
    mr fantastic's Avatar
    Joined
    Dec 2007
    From
    Zeitgeist
    Posts
    16,948
    Thanks
    5
    Quote Originally Posted by ris8_allo_zen0 View Post
    Hi all,
    during some hobby research I encountered a geometrical problem I can't solve for my knowledge. I hope you can give me some help:

    I have a square which I know the edge length (1); then I have a point, outside of it, and segments that connect it to each square's vertex. I know the angles between each segment and the next.
    I need to know the length of at least two segments, and/or the coordinates of the observer if we place all them in a Cartesian plane.

    This is needed for me for a sort of "perspective identification": i need to know the observer's orientation (yaw/pitch/roll) and distance w.r.t. to the reference square. Only when the above problem is solved, I think I can easily adapt it into 3D. But if you have good solution for this "bigger" problem too, feel free to inform me

    Many many many thanks!!! and greetings from Italy!

    Enrico
    Do you know the coordinates of the point outside of the square?
    Follow Math Help Forum on Facebook and Google+

  3. #3
    Flow Master
    mr fantastic's Avatar
    Joined
    Dec 2007
    From
    Zeitgeist
    Posts
    16,948
    Thanks
    5
    Quote Originally Posted by ris8_allo_zen0 View Post
    Hi all,
    during some hobby research I encountered a geometrical problem I can't solve for my knowledge. I hope you can give me some help:

    I have a square which I know the edge length (1); then I have a point, outside of it, and segments that connect it to each square's vertex. I know the angles between each segment and the next.
    I need to know the length of at least two segments, and/or the coordinates of the observer if we place all them in a Cartesian plane.

    This is needed for me for a sort of "perspective identification": i need to know the observer's orientation (yaw/pitch/roll) and distance w.r.t. to the reference square. Only when the above problem is solved, I think I can easily adapt it into 3D. But if you have good solution for this "bigger" problem too, feel free to inform me

    Many many many thanks!!! and greetings from Italy!

    Enrico
    If you don't know the coordinates of the point outside of the square, then one solution is to draw the four different triangles formed by two segments and a side of the square. In each triangle you know the length of a side (edge length of square = 1) and the angle between the two unknown sides (the angle between two segments). You can then use the cosine rule to write down four equations, each equation will have the length of two segments in it.

    Four equations (cosine rule applied to each triangle) and four unknowns (four segments). Solve simultaneously.
    Follow Math Help Forum on Facebook and Google+

  4. #4
    Newbie
    Joined
    Jan 2008
    Posts
    6
    Quote Originally Posted by mr fantastic View Post
    If you don't know the coordinates of the point outside of the square, then one solution is to draw the four different triangles formed by two segments and a side of the square. In each triangle you know the length of a side (edge length of square = 1) and the angle between the two unknown sides (the angle between two segments). You can then use the cosine rule to write down four equations, each equation will have the length of two segments in it.

    Four equations (cosine rule applied to each triangle) and four unknowns (four segments). Solve simultaneously.
    Thank you for the help. Do you think the same would be done with a "half-square" triangle? (e.g. two edges and the diagonal, and just three unknown segments)

    Enrico
    Follow Math Help Forum on Facebook and Google+

  5. #5
    Flow Master
    mr fantastic's Avatar
    Joined
    Dec 2007
    From
    Zeitgeist
    Posts
    16,948
    Thanks
    5
    Quote Originally Posted by ris8_allo_zen0 View Post
    Thank you for the help. Do you think the same would be done with a "half-square" triangle? (e.g. two edges and the diagonal, and just three unknown segments)

    Enrico
    Yes. But first use Pythagoras' Theorem on the triangle to get its hypotenuse. Now lengths of all sides of the triangle are known and you can use the method previously outlined.
    Follow Math Help Forum on Facebook and Google+

  6. #6
    Newbie
    Joined
    Jan 2008
    Posts
    6
    So I have a system of three quadratic equations. Let's say c1, c2, c3 are the cosines of my known angles, and x,y,z the unknown length of segments.
    It looks like this:
    x^2+y^2+2*x*y*c1=1
    z^2+y^2+2*z*y*c2=1
    x^2+z^2+2*x*z*c3=2

    Is that right? If so, the problem is now how to solve systems of quadratic equations. Which is the best method? I tried with substitution but I get square roots into square roots so I don't think it's the right way. The other methods I know are valid only for linear systems, not quadratic... any clue?

    Thanks again!
    Follow Math Help Forum on Facebook and Google+

  7. #7
    Flow Master
    mr fantastic's Avatar
    Joined
    Dec 2007
    From
    Zeitgeist
    Posts
    16,948
    Thanks
    5
    Quote Originally Posted by ris8_allo_zen0 View Post
    So I have a system of three quadratic equations. Let's say c1, c2, c3 are the cosines of my known angles, and x,y,z the unknown length of segments.
    It looks like this:
    x^2+y^2+2*x*y*c1=1
    z^2+y^2+2*z*y*c2=1
    x^2+z^2+2*x*z*c3=2

    Is that right? If so, the problem is now how to solve systems of quadratic equations. Which is the best method? I tried with substitution but I get square roots into square roots so I don't think it's the right way. The other methods I know are valid only for linear systems, not quadratic... any clue?

    Thanks again!
    I haven't checked the equations, but I wasn't expecting thay you'd want exact solutions - approximate solutions using a numerical method are good enough?
    Follow Math Help Forum on Facebook and Google+

  8. #8
    Newbie
    Joined
    Jan 2008
    Posts
    6
    Quote Originally Posted by mr fantastic View Post
    I haven't checked the equations, but I wasn't expecting thay you'd want exact solutions - approximate solutions using a numerical method are good enough?
    I know very little about numerical solving, so I didn't even thought about such a method. An approximate solution is OK for me, but i have some time constraints - the output should be updated at least 50 times at second in a Core 2 processor using Python.
    However I'll try to think about a method, it shouldn't be too difficult. Please tell me if there's an already-made solution!
    Follow Math Help Forum on Facebook and Google+

  9. #9
    Newbie
    Joined
    Jan 2008
    Posts
    6
    Ok, I think I'm on the right way now.

    Let's call \alpha_1 the angle between x and y, and \alpha_2 the one between y and z.
    x and z join the "external" corners with the observer, and y joins the one which is farthest from the obs. Thus, y is between the two and is shared between \alpha_1 and \alpha_2.
    \gamma_1 and \gamma_2 are the angles opposite to x and z, respectively. Since we're working on a half-square, their sum is \frac{\pi}{2}.

    These are the calculations to be done, exploting theorems of sines and cosines:
    \gamma_1=\arcsin(x \sin(\alpha_1))
    y=\sqrt{x^2+1-2x \cos(\pi-\alpha_1-\gamma_1)}
    \gamma_2=\frac{\pi}{2}-\gamma_1
    z=\sqrt{y^2+1-2y \cos(\gamma_2)}
    \alpha_2=\arcsin \left( \frac{\sin \left( \gamma_2 \right) }{z}  \right)

    (am I correct until here?)

    So the the computer's mission is to find an x value such as the calculated \alpha_2 is near enough to the given \alpha_2. This can be done in a way I'll investigate soon


    Thanks mr fantastic to pointing me to the right direction!!!
    Last edited by ris8_allo_zen0; January 14th 2008 at 05:19 AM. Reason: math latex adjust
    Follow Math Help Forum on Facebook and Google+

Similar Math Help Forum Discussions

  1. Satellite Distance Calculation from observer
    Posted in the Trigonometry Forum
    Replies: 6
    Last Post: June 7th 2011, 02:14 PM
  2. Replies: 4
    Last Post: January 26th 2011, 02:11 PM
  3. Replies: 0
    Last Post: January 25th 2011, 02:01 PM
  4. zero position
    Posted in the Calculus Forum
    Replies: 3
    Last Post: May 15th 2010, 10:42 PM
  5. Replies: 1
    Last Post: November 13th 2009, 11:19 AM

Search Tags


/mathhelpforum @mathhelpforum