Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » [MATH] distance in X between two parallel lines

Credits go to Edgar Reynaldo, Niunio, Peter Hull, and Polybios for helping out!
This thread is locked; no one can reply to it. rss feed Print
[MATH] distance in X between two parallel lines
Ariesnl
Member #2,902
November 2002
avatar

Hey everyone, I ran into a math problem, I hope someone can help me out

When the distance of two parallel lines is given and the angle of those lines with the Y axis is also known I want to know the distance in x

Anyone ? thnx

Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard)
Current project: [Star Trek Project ] Join if you want ;-)

Niunio
Member #1,975
March 2002
avatar

What about pitagoras? I mean, trace a line perpendicular to both paralels. Then trace a line with the given angle from one of the new vertex. This should give to you a triangle and you know all angles (the rect one, the one given and its supplementary) and one of the cathetus, so you should be able to calculate the hypotenuse, can't you?

I'm not able to doodle now but I hope you can picture it. ;)

-----------------
Current projects: Allegro.pas | MinGRo

Edgar Reynaldo
Major Reynaldo
May 2007
avatar

Peter Hull
Member #1,136
March 2001

<math>x=d/{cos \theta}</math>

Polybios
Member #12,293
October 2010

Distracting... I think it's x = d / cos(phi).

Edit: beaten.

Edit2: We need a sketch:
{"name":"610966","src":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/c\/ec67707f7a1439cd8c62ba6517fbbef9.png","w":437,"h":357,"tn":"\/\/djungxnpq2nug.cloudfront.net\/image\/cache\/e\/c\/ec67707f7a1439cd8c62ba6517fbbef9"}610966

So:
<math>\varphi' = 90^\circ - \varphi</math>
and
<math>\frac{d}{x} = \sin(\varphi') = \sin(90^\circ - \varphi) = \cos(\varphi) \Rightarrow x = \frac{d}{\cos(\varphi)}</math>

Ariesnl
Member #2,902
November 2002
avatar

Thanks a lot !

Perhaps one day we will find that the human factor is more complicated than space and time (Jean luc Picard)
Current project: [Star Trek Project ] Join if you want ;-)

Niunio
Member #1,975
March 2002
avatar

Polybios said:

Edit2: We need a sketch:

Just that. Thank you. :)

-----------------
Current projects: Allegro.pas | MinGRo

Go to: