On an iOs device I have drawn a line between a startPoint and a endPoint. After drawing that line I want to proceed drawing with 90 degrees from the endPoint. So I have to create a Point on the Screen which I don’t know, because the line could be in any angular.
All was programmed using the CGContextAddLineToPoint.
What is the right direction to look?
Call the points you know A and B, and the one you don’t C.
Then the vector from A to B is:
To rotate a 2d vector by 90 degrees, switch the components and negate one. So you could create:
And then position C at :
For some non-zero t.