### Math trigonometry

A sine calculates the vertical offset between two points based on the angle. A cosine calculates the horizontal distance.

Let's say we have two points, | |

Now let's assume So | |

There is a horizontal and vertical distance between We can use | |

Each line from Measured counterclockwise, starting from 0°, a circle has a total circumference of 360°. So a line from In the case of the line between | |

The cosine function calculates the The sine function calculates the In the case of an angle of 60°, the sine yields 0.5. So the horizontal distance between | |

With sine and cosine we can calculate the distance between This is useful if we have position coordinates for For 60°, the sine yields 0.5, meaning half the length of the distance between So | |

The command in NodeBox would look like this: def coordinates(x0, y0, distance, angle): from math import radians, sin, cos angle = radians(angle) x1 = x0 + cos(angle) * distance y1 = y0 + sin(angle) * distance return x1, y1 |