CGPoint
extension CGPoint
-
Returns the Manhattan or city-block distance between two points.
Declaration
Swift
static func manhattanDistance(from first: CGPoint, to second: CGPoint) -> CGFloatParameters
firstThe starting CGPoint
secondThe destination CGPoint
Return Value
A CGFloat rerpesenting the Manhattan distance between the two points.
-
Returns the Manhattan or city-block distance between two points.
Declaration
Swift
func manhattanDistance(to point: CGPoint) -> CGFloatParameters
pointThe destination CGPoint from itself.
Return Value
A CGFloat rerpesenting the Manhattan distance between the two points.