Beispiel #1
0
        /// <summary>
        /// convert the 3D sphere to a 2D sphere
        /// </summary>
        /// <param name="distance">from the user to the screen</param>
        /// <returns></returns>
        private Sphere2D ToSphere2D(double distance)
        {
            Point2D  center2D = center.Projection(distance);
            double   temp     = (double)Math.Sqrt(center.X * center.X + center.Y * center.Y);
            double   radius2D = (radius + temp) * distance / (distance - center.Z) - center2D.Magnitude;
            Sphere2D sphere2D = new Sphere2D(center2D, radius2D);

            return(sphere2D);
        }
Beispiel #2
0
 public void Draw(Graphics gr, Pen pen, double distance)
 {
     new Line2D(p1.Projection(distance), p2.Projection(distance)).Draw(gr, pen);
     endPoints[1].Draw(gr, Color.Red, distance);
 }
Beispiel #3
0
 /// <summary>
 /// Draw the line to the screen
 /// </summary>
 /// <param name="gr"></param>
 /// <param name="distance"></param>
 public void Draw(Graphics gr, double distance)
 {
     gr.DrawLine(pen, p1.Projection(distance).PointF, p2.Projection(distance).PointF);
 }