Grasshopper c# - Tilted angle

angle error.gh (9.3 KB)

Hey there!
I have a simple turtle graphic code to draw lines by writing strings. The problem is that the resulting line is always slightly tiltes. I guess the problem is some where to convert degree to radian, or something like that. Do you have any idea what is the problem and how I can solve it?

Hi,

Yes you are converting the angle two times in a row in different methods.
Here is a corrected version however the first line is not vertical, it’s also rotated by the angle. I think there is a special case to consider here.

angle error.gh (11.0 KB)

hi @ghazal.refalian I think you should add 2 variables xa an ya (angle) for x and y
And the reason for that error was because your angle is converted to radian 2 times (for 0 and 90 angles), once in the move function and once in the Turtle function



angle Turtle–.gh (18.2 KB)

Thank you!! it is solved!