MCPcopy Create free account
hub / github.com/Notgnoshi/generative / norm

Method norm

generative/dla.rs:235–238  ·  view source on GitHub ↗
(v: &[f64; 2])

Source from the content-addressed store, hash-verified

233 (v[0] * v[0] + v[1] * v[1]).sqrt()
234 }
235 fn norm(v: &[f64; 2]) -> [f64; 2] {
236 let l = Model::length(v);
237 [v[0] / l, v[1] / l]
238 }
239
240 fn lerp(a: &[f64; 2], b: &[f64; 2], d: f64) -> [f64; 2] {
241 // a + unit(b - a) * d

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected