MTExample5_5.Matrix3.Cylindrical C# (CSharp) Method

Cylindrical() public method

public Cylindrical ( float r, float theta, float y ) : Point3
r float
theta float
y float
return Point3
        public Point3 Cylindrical(float r, float theta, float y)
        {
            var pt = new Point3 ();
            var sn = (float)Math.Sin(theta * Math.PI / 180);
            var cn = (float)Math.Cos(theta * Math.PI / 180);
            pt.X = r * cn;
            pt.Y = y;
            pt.Z = -r * sn;
            pt.W = 1;
            return pt;
        }

Usage Example

 public Point3[] CircleCoordinates(float y)
 {
     Point3[] pts = new Point3[30];
     var m = new Matrix3 ();
     for (int i = 0; i < pts.Length; i++)
         pts [i] = m.Cylindrical (r, i * 360 / (pts.Length - 1), y);
     return pts;
 }
All Usage Examples Of MTExample5_5.Matrix3::Cylindrical