Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
 Drew Posts: 4 Registered: 1/25/05
Computing line segments
Posted: Nov 4, 2004 5:39 PM

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 &lt; 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>

Date Subject Author
11/4/04 Drew
11/5/04 J. J. Sroka