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 double GetDoubleExactDist2dSq(DoublePosition pos) { double offX = GetDoublePositionX() - pos.GetDoublePositionX(); double offY = GetDoublePositionY() - pos.GetDoublePositionY(); return((offX * offX) + (offY * offY)); }