#### Archived

This topic is now archived and is closed to further replies.

# drawLine with angle and length

This topic is 5914 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hi all ! can anybody tell me if there is a direct method in openGL to draw a line using a starting point and an angle the length ?? all hints are very much appreciated Yel

##### Share on other sites
I think, there is no method to draw lines with angle and length... Maybe some of the support libraries (glu, glaux, glut) does that.
You can calculate in on your self, so you get two points.

PM

##### Share on other sites

This is what you got:

X1 = 15
Y1 = 30
Length = 50

Then calculate what you need:

X2 = X1 + Length * cos(Angle)
Y2 = Y1 + Length * sin(Angle)

Now draw a line between (X1, Y1) and (X2, Y2).

1. 1
2. 2
3. 3
4. 4
Rutin
12
5. 5

• 12
• 17
• 10
• 14
• 10
• ### Forum Statistics

• Total Topics
632660
• Total Posts
3007697
• ### Who's Online (See full list)

There are no registered users currently online

×