Beispiel #1
0
        public static SPoint SymmetryPoint(SPoint Point_, SLine Line_)
        {
            SPoint PointVector = Point_.Sub(Line_.Point0);
            var    NewTheta    = (Mathf.Atan2(PointVector.Y, PointVector.X) - 2.0f * ThetaOfTwoVectors(PointVector, Line_.Point1.Sub(Line_.Point0)));
            var    Radius      = Mathf.Sqrt(PointVector.X * PointVector.X + PointVector.Y * PointVector.Y);

            return(new SPoint(Mathf.Cos(NewTheta) * Radius, Mathf.Sin(NewTheta) * Radius).Add(Line_.Point0));
        }
Beispiel #2
0
 public static bool IsOverlappedPointPointRect(SPoint Point_, SPointRect PointRect_)
 {
     return(
         CBase.ThetaOfTwoVectors(PointRect_.TopLeft.Sub(PointRect_.TopRight), Point_.Sub(PointRect_.TopRight)) < 0.0 &&
         CBase.ThetaOfTwoVectors(PointRect_.BottomLeft.Sub(PointRect_.TopLeft), Point_.Sub(PointRect_.TopLeft)) < 0.0 &&
         CBase.ThetaOfTwoVectors(PointRect_.BottomRight.Sub(PointRect_.BottomLeft), Point_.Sub(PointRect_.BottomLeft)) < 0.0 &&
         CBase.ThetaOfTwoVectors(PointRect_.TopRight.Sub(PointRect_.BottomRight), Point_.Sub(PointRect_.BottomRight)) < 0.0);
 }