I have a situation where I have angle of the normal to a line in 2D plane and a point on line as well. I need to find slope, x and y intercepts of the line.
Diagram of 2D plane, X-axis Horizontal and Y-axis Vertical
In the diagram above I have angle θ and (x1,y1) representing green dot on the dotted red line. The blue line is normal to the dotted red line.
Once I'm able to find the slope and intercepts of the dotted red line, I would want to test a given point (x2,y2) or (x3,y3), whether it is above the dotted red line or below it.
I would appreciate if python is provided for the solution but not necessary.
Update: Actually the angle θ, represents the direction of a triangle (considered as an arrow) and dotted red line is the normal at it's tip. So please note that the angle θ relative to the x-axis may vary between 0 to 360 degree, however all the arrows will still remain in 1st quadrant, as shown in the diagram below.
Triangles in First Quadrant of 2D Plane
Thanks,
The equation of the line: $$y=ax+b=-\frac{1}{\tan{\theta}}x+b.$$
Now substitute the give point $(x_1,y_1)$ to find $b$, which is the $y$-intercept: $$b=y_1+\frac{1}{\tan{\theta}}x_1.$$
Thus the equation of the line: $$y=-\frac{1}{\tan{\theta}}x+y_1+\frac{1}{\tan\theta}x_1.$$
The $x$-intercept is (by setting $y=0$): $$x=y_1\tan\theta+x_1.$$