Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SKTUtils/CGFloat+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
import CoreGraphics

/** The value of π as a CGFloat */
let π = CGFloat(M_PI)
let π = CGFloat(Double.pi)

public extension CGFloat {
/**
Expand Down
2 changes: 1 addition & 1 deletion SKTUtils/CGPoint+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public extension CGPoint {
* Returns the length (magnitude) of the vector described by the CGPoint.
*/
public func length() -> CGFloat {
return sqrt(x*x + y*y)
return hypot(x, y)
}

/**
Expand Down
2 changes: 1 addition & 1 deletion SKTUtils/CGVector+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public extension CGVector {
* Returns the length (magnitude) of the vector described by the CGVector.
*/
public func length() -> CGFloat {
return sqrt(dx*dx + dy*dy)
return hypot(dx, dy)
}

/**
Expand Down