AForge.Math.Geometry.Line.Line C# (CSharp) Method

Line() private method

private Line ( float radius, float theta, bool unused ) : System
radius float
theta float
unused bool
return System
		private Line( float radius, float theta, bool unused )
		{
			if ( radius < 0 )
			{
				Throw(radius);
			}

			theta *= (float) ( Math.PI / 180 );

			float sine = (float) Math.Sin( theta ), cosine = (float) Math.Cos( theta );
			Point pt1 = new Point( radius * cosine, radius * sine );

			// -1/tan, to get the slope of the line, and not the slope of the normal
			k = -cosine / sine;

			if ( !float.IsInfinity( k ) )
			{
				b = pt1.Y - k * pt1.X;
			}
			else
			{
				b = Math.Abs( radius );
			}
		}

Same methods

Line::Line ( Point start, Point end ) : System
Line::Line ( Point point, float theta ) : System
Line::Line ( float slope, float intercept ) : System