public double GetDoubleExactDist2dSq(DoublePosition pos) { double offX = GetDoublePositionX() - pos.GetDoublePositionX(); double offY = GetDoublePositionY() - pos.GetDoublePositionY(); return((offX * offX) + (offY * offY)); }
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(); }
// 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(); }
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(); }
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(); }
public EllipseBoundary(DoublePosition center, double radiusX, double radiusY, bool isInverted = false) : base(BoundaryType.Ellipse, isInverted) { _center = center; _radiusYSq = radiusY * radiusY; _scaleXSq = _radiusYSq / (radiusX * radiusX); }
public CircleBoundary(DoublePosition center, DoublePosition pointOnCircle, bool isInverted = false) : base(BoundaryType.Circle, isInverted) { _center = center; _radiusSq = center.GetDoubleExactDist2dSq(pointOnCircle); }
public CircleBoundary(DoublePosition center, double radius, bool isInverted = false) : base(BoundaryType.Circle, isInverted) { _center = center; _radiusSq = radius * radius; }
public EllipseBoundary(Position center, double radiusX, double radiusY, bool isInverted = false) : base(isInverted) { _center = new DoublePosition(center); _radiusYSq = radiusY * radiusY; _scaleXSq = _radiusYSq / (radiusX * radiusX); }
public CircleBoundary(Position center, Position pointOnCircle, bool isInverted = false) : base(isInverted) { _center = new DoublePosition(center); _radiusSq = _center.GetDoubleExactDist2dSq(new DoublePosition(pointOnCircle)); }
public CircleBoundary(Position center, double radius, bool isInverted = false) : base(isInverted) { _center = new DoublePosition(center); _radiusSq = radius * radius; }