• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 372
  • Last Modified:

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

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) ?
0
UniqSoft
Asked:
UniqSoft
1 Solution
 
d-glitchCommented:
x1 = x0  + length*cos(angle)
y1 = y0  + length*sin(angle)
0
 
jitendra_wadhwaniCommented:
Yes.... d-glitch  is absolutely right..
x1 = x0  + length*cos(angle)
y1 = y0  + length*sin(angle)

All point to  d-glitch as replied first
0
 
TalmashCommented:
in case of cos/sin using radians, need to convert angle from degrees to radians :
angle = angle*PI/180 (PI=4.13152965)
0
 
UniqSoftAuthor Commented:
Thanks a bunch
0

Featured Post

[Webinar] Cloud and Mobile-First Strategy

Maybe you’ve fully adopted the cloud since the beginning. Or maybe you started with on-prem resources but are pursuing a “cloud and mobile first” strategy. Getting to that end state has its challenges. Discover how to build out a 100% cloud and mobile IT strategy in this webinar.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now