Useful extensions and functions used with coregraphics types like CGFloat, CGPoint, and CGSize
Checkout the collisions example project for how to make use of the functions in SwiftUI
Clamps within range of two given values
atanP
- function returns only positive values between [0, 2π]calculateDirection
-Calculates the direction between two points relative to the vector pointing in the trailing directionproject
- Projects the point p
onto the line segment defined by the points L1
and L2
calculateParameter
- Projects the point p
onto the vector defined by the points L1
and L2
, uses the parametric form of the line segment from L1
to L2
to constrain the projected point to be on the line segmentdistance
- gets the distance between two pointslink |
Stars: 16 |
Last commit: 3 years ago |
Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics