A Swift library extending CoreGraphics with intuitive geometric types and functions for 2D calculations.
Metron is a Swift library that extends CoreGraphics with additional geometric types and functions for 2D calculations. It provides an intuitive API for handling lines, circles, polygons, angles, and more, simplifying complex geometric operations in iOS and macOS development.
iOS and macOS developers working with graphics, UI, or games who need robust geometric calculations beyond CoreGraphics' basic primitives.
Developers choose Metron for its comprehensive, Swift-native geometric toolkit that reduces code complexity, offers type safety, and integrates seamlessly with CoreGraphics, making geometry more approachable.
Geometry, simplified.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Extends CoreGraphics types like CGPoint and CGRect with operations such as distance calculation, convex hulls, and transformations, reducing boilerplate code for common geometric tasks.
Offers clear, readable syntax for complex operations, exemplified by checks like Circle(in: viewFrame).contains(touchPoint) and line intersection calculations, enhancing code clarity.
Supports angles in both radians and degrees with normalization and conversion, as shown in the README example adding an angle in radians to one in degrees.
Converts geometric shapes like Polygon and Circle directly into CGPath for drawing, simplifying integration with CoreGraphics rendering without manual path creation.
Tied to Apple's CoreGraphics framework, limiting use to iOS and macOS and making it unsuitable for cross-platform or non-Apple development environments.
Adds dependency and code bloat for projects that only need basic CoreGraphics functionality, where manual calculations might be more lightweight and sufficient.
Lacks support for 3D geometry, transformations, or advanced features like bezier curves, which are available in other libraries or CoreGraphics extensions.