I want to go from the Cartesian representation to Polar points on an image (a circle) that I imported from my computer but I do not know how to do it.
Here is the code I have already tried:
private double rho (double t)
{
return (po-(vrot*tp*t));
}
private double tetha (double t)
{
return vrot*2*Math.PI*t;
}
private double x (double t)
{
return rho(t) * Math.Sin(tetha(t));
}
private double y (double t)
{
return rho(t) * Math.Cos(tetha(t));
}
public void DrawLinePoint(Bitmap bmp)
{
// Create pen.
Pen blackPen = new Pen(Color.Red, 3);
// Create points that define line.
PointF[] points =
{
new PointF((float)x(1.81818182),(float)y(1.81818182)),
new PointF((float)x(3.63636364), (float)y(3.63636364)),
};
// Draw line to screen.
using(var graphics = Graphics.FromImage(bmp))
{
graphics.DrawLines(blackPen, points);
}
}