Skip to content

Commit d9f8c2c

Browse files
committed
introduce vectorized min and max for vec2f
1 parent 75433ac commit d9f8c2c

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Sources/Vector2.swift

+8
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,11 @@ extension Vector2f: CustomStringConvertible {
4343
}
4444
}
4545

46+
public func min(_ lhs: Vector2f, _ rhs: Vector2f) -> Vector2f {
47+
return .init(min(lhs.x, rhs.x), min(lhs.y, rhs.y))
48+
}
49+
50+
public func max(_ lhs: Vector2f, _ rhs: Vector2f) -> Vector2f {
51+
return .init(max(lhs.x, rhs.x), max(lhs.y, rhs.y))
52+
}
53+

0 commit comments

Comments
 (0)