-
-
Notifications
You must be signed in to change notification settings - Fork 9
math
IsaacShelton edited this page Nov 13, 2022
·
6 revisions
2.7/math.adept
defines a commonly used math procedures.
define E = 2.71828182845904523536028747135266249775724709369995957496696763
define PI = 3.14159265358979323846264338327950288419716939937510582097494459
define PHI = 1.61803398874989484820458683436563811772030917980576286213544862
define SQRT2 = 1.41421356237309504880168872420969807856967187537694807317667974
-
func max(a, b $T) $T
Returns the larger of two values.
-
func max(a, b, c $T) $T
Returns the largest of three values.
-
func min(a, b $T) $T
Returns the smaller of two values.
-
func min(a, b, c $T) $T
Returns the smallest of three values.
-
func clamp(value $T, min, max $~T) $T
Returns a value clamped between
min
andmax
. -
func distance(x1, y1, x2, y2 float) float
Returns the distance between two points.
-
func distance(x1, y1, x2, y2 double) double
Returns the distance between two points.
Other symbols are imported indirectly from 2.7/cmath.adept