Example #1
0
        public Point3D CalculateRotationY(Point3D input, double rotaY)
        {
            Point3[] pts = new Point3[1];

            pts[0] = new Point3(input.X, input.Y, input.Z, 0);

            Matrix3 m = Matrix3.Rotate3Y(rotaY);

            pts[0].Transform(m);

            Point3D output = new Point3D(pts[0].X, pts[0].Y, pts[0].Z);

            return output;
        }
Example #2
0
        public Point3D CalculateAzimuth(Point3D input,double elevation,double azimuth)
        {
            Point3[] pts = new Point3[1];

            pts[0] = new Point3(input.X, input.Y, input.Z,0);

            Matrix3 m = Matrix3.AzimuthElevation(elevation,azimuth,0);

            pts[0].Transform(m);

            Point3D output = new Point3D(pts[0].X,pts[0].Y,pts[0].Z);

            return output;
        }
Example #3
0
        public Point3 Spherical(double r, double theta, double phi)
        {
            var pt = new Point3();

            var snt = Math.Sin(theta * Math.PI / 180);
            var cnt = Math.Cos(theta * Math.PI / 180);

            var snp = Math.Sin(phi * Math.PI / 180);
            var cnp = Math.Cos(phi * Math.PI / 180);

            pt.X = r * snt * cnp;
            pt.Y = r * cnt;
            pt.Z = -r * snt * cnp;
            pt.W = 1;

            return pt;
        }
Example #4
0
        public Point3 Cylindrical(double r, double theta, double y)
        {
            var pt = new Point3();

            var sn = Math.Sin(theta * Math.PI / 180);
            var cn = Math.Cos(theta * Math.PI / 180);

            pt.X = r * cn;
            pt.Y = y;
            pt.Z = -r * sn;
            pt.W = 1;

            return pt;
        }
Example #5
0
        public Point3D CalculateScaling(Point3D input, Point3D scaling)
        {
            Point3[] pts = new Point3[1];

            pts[0] = new Point3(input.X, input.Y, input.Z, 0);

            Matrix3 m = Matrix3.Scale3(scaling.X, scaling.Y, scaling.Z);

            pts[0].Transform(m);

            Point3D output = new Point3D(pts[0].X, pts[0].Y, pts[0].Z);

            return output;
        }
Example #6
0
        public Point3D CalculateTranslation(Point3D input,Point3D displacement)
        {
            Point3[] pts = new Point3[1];

            pts[0] = new Point3(input.X, input.Y, input.Z, 0);

            Matrix3 m = Matrix3.Translate3(displacement.X,displacement.Y,displacement.Z);

            pts[0].Transform(m);

            Point3D output = new Point3D(pts[0].X, pts[0].Y, pts[0].Z);

            return output;
        }