MCPcopy
hub / github.com/tdewolff/canvas / angleNorm

Function angleNorm

util.go:69–75  ·  view source on GitHub ↗

angleNorm returns the angle theta in the range [0,2PI).

(theta float64)

Source from the content-addressed store, hash-verified

67
68// angleNorm returns the angle theta in the range [0,2PI).
69func angleNorm(theta float64) float64 {
70 theta = math.Mod(theta, 2.0*math.Pi)
71 if theta < 0.0 {
72 theta += 2.0 * math.Pi
73 }
74 return theta
75}
76
77// angleTime returns the time [0.0,1.0] of theta between [lower,upper]. When outside of [lower,upper], the result will also be outside of [0.0,1.0].
78func angleTime(theta, lower, upper float64) float64 {

Callers 15

TestAngleNormFunction · 0.85
ArcToMethod · 0.85
CCWMethod · 0.85
TransformMethod · 0.85
ellipseToCenterFunction · 0.85
xmonotoneEllipticArcFunction · 0.85
angleTimeFunction · 0.85
angleBetweenFunction · 0.85
angleBetweenExclusiveFunction · 0.85
AngleMethod · 0.85
StringMethod · 0.85
intersectionLineQuadFunction · 0.85

Calls

no outgoing calls

Tested by 1

TestAngleNormFunction · 0.68