Esempio n. 1
0
            public double GetDoubleExactDist2dSq(DoublePosition pos)
            {
                double offX = GetDoublePositionX() - pos.GetDoublePositionX();
                double offY = GetDoublePositionY() - pos.GetDoublePositionY();

                return((offX * offX) + (offY * offY));
            }
Esempio n. 2
0
 public ParallelogramBoundary(DoublePosition cornerA, DoublePosition cornerB, DoublePosition cornerD, bool isInverted = false) : base(BoundaryType.Parallelogram, isInverted)
 {
     _a   = cornerA;
     _b   = cornerB;
     _d   = cornerD;
     _c   = new DoublePosition(_d.GetDoublePositionX() + (_b.GetDoublePositionX() - _a.GetDoublePositionX()), _d.GetDoublePositionY() + (_b.GetDoublePositionY() - _a.GetDoublePositionY()));
     _abx = _b.GetDoublePositionX() - _a.GetDoublePositionX();
     _dax = _a.GetDoublePositionX() - _d.GetDoublePositionX();
     _aby = _b.GetDoublePositionY() - _a.GetDoublePositionY();
     _day = _a.GetDoublePositionY() - _d.GetDoublePositionY();
 }
Esempio n. 3
0
 // Note: AB must be orthogonal to AD
 public ParallelogramBoundary(Position cornerA, Position cornerB, Position cornerD, bool isInverted = false) : base(isInverted)
 {
     _a   = new DoublePosition(cornerA);
     _b   = new DoublePosition(cornerB);
     _d   = new DoublePosition(cornerD);
     _c   = new DoublePosition(_d.GetDoublePositionX() + (_b.GetDoublePositionX() - _a.GetDoublePositionX()), _d.GetDoublePositionY() + (_b.GetDoublePositionY() - _a.GetDoublePositionY()));
     _abx = _b.GetDoublePositionX() - _a.GetDoublePositionX();
     _dax = _a.GetDoublePositionX() - _d.GetDoublePositionX();
     _aby = _b.GetDoublePositionY() - _a.GetDoublePositionY();
     _day = _a.GetDoublePositionY() - _d.GetDoublePositionY();
 }
Esempio n. 4
0
 public TriangleBoundary(DoublePosition pointA, DoublePosition pointB, DoublePosition pointC, bool isInverted = false) : base(BoundaryType.Triangle, isInverted)
 {
     _a   = pointA;
     _b   = pointB;
     _c   = pointC;
     _abx = _b.GetDoublePositionX() - _a.GetDoublePositionX();
     _bcx = _c.GetDoublePositionX() - _b.GetDoublePositionX();
     _cax = _a.GetDoublePositionX() - _c.GetDoublePositionX();
     _aby = _b.GetDoublePositionY() - _a.GetDoublePositionY();
     _bcy = _c.GetDoublePositionY() - _b.GetDoublePositionY();
     _cay = _a.GetDoublePositionY() - _c.GetDoublePositionY();
 }
Esempio n. 5
0
        public TriangleBoundary(Position pointA, Position pointB, Position pointC, bool isInverted = false) : base(isInverted)
        {
            _a = new DoublePosition(pointA);
            _b = new DoublePosition(pointB);
            _c = new DoublePosition(pointC);

            _abx = _b.GetDoublePositionX() - _a.GetDoublePositionX();
            _bcx = _c.GetDoublePositionX() - _b.GetDoublePositionX();
            _cax = _a.GetDoublePositionX() - _c.GetDoublePositionX();
            _aby = _b.GetDoublePositionY() - _a.GetDoublePositionY();
            _bcy = _c.GetDoublePositionY() - _b.GetDoublePositionY();
            _cay = _a.GetDoublePositionY() - _c.GetDoublePositionY();
        }
Esempio n. 6
0
 public EllipseBoundary(DoublePosition center, double radiusX, double radiusY, bool isInverted = false) : base(BoundaryType.Ellipse, isInverted)
 {
     _center    = center;
     _radiusYSq = radiusY * radiusY;
     _scaleXSq  = _radiusYSq / (radiusX * radiusX);
 }
Esempio n. 7
0
 public CircleBoundary(DoublePosition center, DoublePosition pointOnCircle, bool isInverted = false) : base(BoundaryType.Circle, isInverted)
 {
     _center   = center;
     _radiusSq = center.GetDoubleExactDist2dSq(pointOnCircle);
 }
Esempio n. 8
0
 public CircleBoundary(DoublePosition center, double radius, bool isInverted = false) : base(BoundaryType.Circle, isInverted)
 {
     _center   = center;
     _radiusSq = radius * radius;
 }
Esempio n. 9
0
 public EllipseBoundary(Position center, double radiusX, double radiusY, bool isInverted = false) : base(isInverted)
 {
     _center    = new DoublePosition(center);
     _radiusYSq = radiusY * radiusY;
     _scaleXSq  = _radiusYSq / (radiusX * radiusX);
 }
Esempio n. 10
0
 public CircleBoundary(Position center, Position pointOnCircle, bool isInverted = false) : base(isInverted)
 {
     _center   = new DoublePosition(center);
     _radiusSq = _center.GetDoubleExactDist2dSq(new DoublePosition(pointOnCircle));
 }
Esempio n. 11
0
 public CircleBoundary(Position center, double radius, bool isInverted = false) : base(isInverted)
 {
     _center   = new DoublePosition(center);
     _radiusSq = radius * radius;
 }