Beispiel #1
0
        public DoublePoint3D RotateY(double radians)
        {
            var result = new DoublePoint3D();

            result.X = Math.Cos(radians) * X + Math.Sin(radians) * Z;
            result.Y = Y;
            result.Z = -Math.Sin(radians) * X + Math.Cos(radians) * Z;

            return(new DoublePoint3D(result.X, result.Y, result.Z));
        }
Beispiel #2
0
        public DoublePoint3D RotateX(double radians)
        {
            var result = new DoublePoint3D();

            result.X = X;
            result.Y = Math.Cos(radians) * Y - Math.Sin(radians) * Z;
            result.Z = Math.Sin(radians) * Y + Math.Cos(radians) * Z;

            return(new DoublePoint3D(result.X, result.Y, result.Z));
        }
Beispiel #3
0
        private DoublePoint2D To2D(DoublePoint3D point)
        {
            var result = new DoublePoint2D();
            var xAngle = Math.PI / 6;
            var zAngle = Math.PI / 6;

            result.X = Math.Cos(xAngle) * point.X - Math.Cos(zAngle) * point.Z;
            result.Y = point.Y - Math.Sin(xAngle) * point.X - Math.Sin(zAngle) * point.Z;

            return(result);
        }
Beispiel #4
0
        public override void Draw(LabParameters labParameters)
        {
            if (!(labParameters is ThirdLabParameters parameters))
            {
                throw new ArgumentException($"{nameof(labParameters)} has wrong type: {labParameters.GetType().Name}");
            }

            var areaPoints = new DoublePoint3D[parameters.AreaPointsXY.Length];

            for (var i = 0; i < parameters.AreaPointsXY.Length; i++)
            {
                areaPoints[i] = new DoublePoint3D(parameters.AreaPointsXY[i], parameters.AreaPointZ[i]);
            }

            DrawLab(areaPoints, parameters.XRotateDegree, parameters.YRotateDegree);
        }