Example #1
0
        private static void GenerateTriangleQuadrant(int quadrant,
                                                     ZotCoordinate perpendicularPoint, ZotCoordinate westMost, ZotCoordinate eastMost,
                                                     out ZotCoordinate subPerpendicular, out ZotCoordinate subWestMost, out ZotCoordinate subEastMost
                                                     )
        {
            switch (quadrant)
            {
            case 0:
                // Pole inversion
                subPerpendicular = CoordinateExtensions.InBetween(eastMost, westMost);
                subEastMost      = CoordinateExtensions.InBetween(westMost, perpendicularPoint);
                subWestMost      = CoordinateExtensions.InBetween(eastMost, perpendicularPoint);
                break;

            case 2:
                subPerpendicular = CoordinateExtensions.InBetween(eastMost, perpendicularPoint);
                subEastMost      = eastMost;
                subWestMost      = CoordinateExtensions.InBetween(eastMost, westMost);
                break;

            case 1:
                subPerpendicular = CoordinateExtensions.InBetween(westMost, perpendicularPoint);
                subEastMost      = CoordinateExtensions.InBetween(westMost, eastMost);
                subWestMost      = westMost;
                break;

            case 3:
                subPerpendicular = perpendicularPoint;
                subWestMost      = CoordinateExtensions.InBetween(perpendicularPoint, westMost);
                subEastMost      = CoordinateExtensions.InBetween(eastMost, perpendicularPoint);
                break;

            default:
                throw new ArgumentException("Invalid quadrant: " + quadrant);
            }
        }
Example #2
0
 public static ZotCoordinate GenerateCenterPoint(int[] id)
 {
     var(p, east, west) = GenerateTriangleZot(id);
     return(CoordinateExtensions.InBetween(p, CoordinateExtensions.InBetween(east, west)));
 }