public LineIntegral(CurveType type, IntegrationDirection direction, CurveArea area, double r) { double x; double y; double t = 2 * Math.PI; if (type == CurveType.Circle && area == CurveArea.Full) { if (direction == IntegrationDirection.Clockwise) { x = r * Math.Cos(t); y = r * Math.Cos(t); } } }
public override void Refresh() { UnSnap(); if (curvesorter != null) { RemovePart(curvesorter); curvesorter.Dispose(); } curvesorter = new CurveArea(0, ((SorterElementInfo)Info).SorterWidth, ((SorterElementInfo)Info).CurveRadius, ((SorterElementInfo)Info).CurveDegrees, ((SorterElementInfo)Info).Revolution) { Color = Info.color, RenderOption = RigidPart.RenderingMode.PrimitiveAndNormal, HeightDifference = ((SorterElementInfo)Info).HeightDifference }; Add(curvesorter); if (((SorterElementInfo)Info).Revolution == Core.Environment.Revolution.Clockwise) { curvesorter.LocalYaw = (float)Math.PI / 2 - ((SorterElementInfo)Info).CurveDegrees / 180 * (float)Math.PI; Vector3 dir = new Vector3(1, 0, 0); dir.TransformCoordinate(Matrix.RotationY(-((SorterElementInfo)Info).CurveDegrees / 180 * (float)Math.PI)); StartFixPoint.LocalYaw = -((SorterElementInfo)Info).CurveDegrees / 180 * (float)Math.PI - (float)Math.PI / 2; StartFixPoint.LocalPosition = dir * ((SorterElementInfo)Info).CurveRadius; EndFixPoint.LocalYaw = -(float)Math.PI / 2; EndFixPoint.LocalPosition = new Vector3(((SorterElementInfo)Info).CurveRadius, curvesorter.HeightDifference, 0); } else { curvesorter.LocalYaw = ((SorterElementInfo)Info).CurveDegrees / 180 * (float)Math.PI - (float)Math.PI / 2; Vector3 dir = new Vector3(-1, 0, 0); dir.TransformCoordinate(Matrix.RotationY(((SorterElementInfo)Info).CurveDegrees / 180 * (float)Math.PI)); StartFixPoint.LocalYaw = ((SorterElementInfo)Info).CurveDegrees / 180 * (float)Math.PI - (float)Math.PI / 2; StartFixPoint.LocalPosition = dir * ((SorterElementInfo)Info).CurveRadius; EndFixPoint.LocalYaw = -(float)Math.PI / 2; EndFixPoint.LocalPosition = new Vector3(-((SorterElementInfo)Info).CurveRadius, curvesorter.HeightDifference, 0); } base.Length = 2 * (float)Math.PI * ((SorterElementInfo)Info).CurveRadius * ((SorterElementInfo)Info).CurveDegrees / 360; }