public static ILucidGeometry Create(string geometryJson) { if (geometryJson.Contains("\"x\"")) { return(LucidPoint.Create(geometryJson)); } if (geometryJson.Contains("\"xmax\"")) { return(LucidExtent.Create(geometryJson)); } if (geometryJson.Contains("\"paths\"")) { return(LucidLine.Create(geometryJson)); } if (geometryJson.Contains("\"rings\"")) { return(LucidPolygon.Create(geometryJson)); } throw new Exception($"Unrecognized geometry type {geometryJson}"); }
/// <summary> /// Determines the angle in radians of a targetPoint vector with the origin being (0,0). /// </summary> /// <param name="targetPoint">The point to find the angle of.</param> /// <returns>The angle of the target point about (0,0)</returns> public static double Angle(IPoint targetPoint) { return(Angle(LucidPoint.Create(0, 0), targetPoint)); }