We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Calculating the endpoint of a straight line, given its startpoint, length and angle

UniqSoft
UniqSoft asked
on
Medium Priority
391 Views
Last Modified: 2008-03-03
I'm presently using automation to draw in Microsoft Visio. I have the startpoint (x0, y0), the length, and the angle with the x-axis (in degrees) of a straight line. How do i calculate the endpoint (x1, y1) ?
Comment
Watch Question

CERTIFIED EXPERT
Commented:
x1 = x0  + length*cos(angle)
y1 = y0  + length*sin(angle)

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts
Yes.... d-glitch  is absolutely right..
x1 = x0  + length*cos(angle)
y1 = y0  + length*sin(angle)

All point to  d-glitch as replied first
TalmashCEO

Commented:
in case of cos/sin using radians, need to convert angle from degrees to radians :
angle = angle*PI/180 (PI=4.13152965)

Author

Commented:
Thanks a bunch
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.