// Drawing a line of length L from x1, y1 tilted at an angle // Using Trigonometry functions
void setup() { size(500, 500); background(255); noLoop(); } // setup()
void draw() { // draw a line of length, L starting at 400, 400 of angle 30 degrees float L = 250; float x1 = 300, y1 = 200; float angle = 200; float x2 = x1 + L * cos(radians(angle)); float y2 = y1 + L * sin(radians(angle)); line(x1, y1, x2, y2); } // draw()