MCPcopy Create free account
hub / github.com/VCVRack/Rack / rotate

Method rotate

include/math.hpp:246–250  ·  view source on GitHub ↗

Rotates counterclockwise in radians. */

Source from the content-addressed store, hash-verified

244 }
245 /** Rotates counterclockwise in radians. */
246 Vec rotate(float angle) {
247 float sin = std::sin(angle);
248 float cos = std::cos(angle);
249 return Vec(x * cos - y * sin, x * sin + y * cos);
250 }
251 /** Swaps the coordinates.
252 Equivalent to a reflection across the `y = x` line.
253 */

Callers 2

setAngleMethod · 0.45
onChangeMethod · 0.45

Calls 3

sinFunction · 0.85
cosFunction · 0.85
VecClass · 0.85

Tested by

no test coverage detected