Reputation: 317
I want to draw line from one point to another unknown point.I want to find this unknown point using its angle and radius from current point. Then i want to draw between these two points as line..
Can anyone help me?
Thanks in advance...
Note:
I already used these method
x2 = x1 - length * cos(angle)
y2 = y1 - length * sin(angle)
But these found point is not correct for some angle...
Upvotes: 1
Views: 460
Reputation: 185862
Some things to check:
-
and +
after ... = x1
and ... = y1
depends on the angular coordinate system you want to use. Make sure you've got this right.cos
and sin
may need to be swapped.angle
in radians? If it's in degrees, it won't work.Note that I'm not suggesting you have points 1 and 2 wrong. It's impossible to say without knowing how you want your geometry to function, and what coordinate system you're using. Plus, the iPhone SDKs are a bit schizophrenic in this regard.
Upvotes: 1