Math Help Forum

Math Help Forum Feed Site Feed

Go Back   Math Help Forum > High School Math Help > Trigonometry
Reply
 
Thread Tools Display Modes
  #1  
Old 01-12-2008, 07:21 PM
Junior Member
 
Join Date: Jan 2008
Posts: 6
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
ris8_allo_zen0 is on a distinguished road
Default 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
Reply With Quote
Advertisement
 
  #2  
Old 01-12-2008, 10:10 PM
mr fantastic's Avatar
Flow Master
 
Join Date: Dec 2007
Location: Zeitgeist
Posts: 6,069
Country:
Thanks: 957
Thanked 2,345 Times in 2,119 Posts
mr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond repute
Default

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?
__________________
There are two things you should never try to prove ...... the impossible and the obvious.

Lack of planning on your part does not constitute an emergency on my part.

Pressure makes diamonds.
Reply With Quote
  #3  
Old 01-12-2008, 10:24 PM
mr fantastic's Avatar
Flow Master
 
Join Date: Dec 2007
Location: Zeitgeist
Posts: 6,069
Country:
Thanks: 957
Thanked 2,345 Times in 2,119 Posts
mr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond repute
Default

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.
__________________
There are two things you should never try to prove ...... the impossible and the obvious.

Lack of planning on your part does not constitute an emergency on my part.

Pressure makes diamonds.
Reply With Quote
  #4  
Old 01-13-2008, 04:18 AM
Junior Member
 
Join Date: Jan 2008
Posts: 6
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
ris8_allo_zen0 is on a distinguished road
Default

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
Reply With Quote
  #5  
Old 01-13-2008, 05:39 AM
mr fantastic's Avatar
Flow Master
 
Join Date: Dec 2007
Location: Zeitgeist
Posts: 6,069
Country:
Thanks: 957
Thanked 2,345 Times in 2,119 Posts
mr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond repute
Default

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.
__________________
There are two things you should never try to prove ...... the impossible and the obvious.

Lack of planning on your part does not constitute an emergency on my part.

Pressure makes diamonds.
Reply With Quote
  #6  
Old 01-13-2008, 08:32 AM
Junior Member
 
Join Date: Jan 2008
Posts: 6
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
ris8_allo_zen0 is on a distinguished road
Default

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!
Reply With Quote
  #7  
Old 01-13-2008, 01:47 PM
mr fantastic's Avatar
Flow Master
 
Join Date: Dec 2007
Location: Zeitgeist
Posts: 6,069
Country:
Thanks: 957
Thanked 2,345 Times in 2,119 Posts
mr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond reputemr fantastic has a reputation beyond repute
Default

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?
__________________
There are two things you should never try to prove ...... the impossible and the obvious.

Lack of planning on your part does not constitute an emergency on my part.

Pressure makes diamonds.
Reply With Quote
  #8  
Old 01-13-2008, 02:19 PM
Junior Member
 
Join Date: Jan 2008
Posts: 6
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
ris8_allo_zen0 is on a distinguished road
Default

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!
Reply With Quote
  #9  
Old 01-14-2008, 05:13 AM
Junior Member
 
Join Date: Jan 2008
Posts: 6
Country:
Thanks: 0
Thanked 0 Times in 0 Posts
ris8_allo_zen0 is on a distinguished road
Default

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; 01-14-2008 at 07:19 AM. Reason: math latex adjust
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off
Forum Jump


All times are GMT -7. The time now is 06:05 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.
©2005 - 2008 Math Help Forum


Math Help Forum is a community of maths forums with an emphasis on maths help in all levels of mathematics.
Register to post your math questions or just hang out and try some of our math games or visit the arcade.