Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Inactive » k12.ed.math

Topic: Computing line segments
Replies: 3   Last Post: Nov 8, 2004 4:58 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Drew

Posts: 4
Registered: 1/25/05
Computing line segments
Posted: Nov 4, 2004 5:39 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Given a point on a cartesian coordinate plane (x1, y1), a slope (m),
and a length (n), how would I go about calculating the two possible
points (x2, y2) and (x3, y3) that consist of the endpoints of the line
segment without using trig. functions?

I know I can do this:

if (m < 0) k = arctan(m) + PI
else k = arctan(m)

q = n / 2
r = q * cos(k)
s = q * sin(k)
x2 = x1 + r
y2 = y1 + s
x3 = x1 - r
y3 = y1 - s

That gets it down to three trig. functions, two multiplies, and one
divide (addition and subtraction doesn't matter). Anyone know of a
way to do this that doesn't involve trig. or Newton's method? It
_can_ be an approximation, but it needs to be accurate to at least 5
decimal places and computationally simple in all circumstances.

--
submissions: post to k12.ed.math or e-mail to k12math@k12groups.org
private e-mail to the k12.ed.math moderator: kem-moderator@k12groups.org
newsgroup website: <a href="http://www.thinkspot.net/k12math/">http://www.thinkspot.net/k12math/</a>
newsgroup charter: <a href="http://www.thinkspot.net/k12math/charter.html">http://www.thinkspot.net/k12math/charter.html</a>




Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.