From 592d6bfcbd7b4fb6644b0fea45908cd3852e99c0 Mon Sep 17 00:00:00 2001 From: celyk Date: Sun, 6 Jul 2025 19:10:18 +1000 Subject: [PATCH] Add comments --- node-graph/gmath-nodes/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/node-graph/gmath-nodes/src/lib.rs b/node-graph/gmath-nodes/src/lib.rs index b4d76432c..f76cba4aa 100644 --- a/node-graph/gmath-nodes/src/lib.rs +++ b/node-graph/gmath-nodes/src/lib.rs @@ -612,11 +612,13 @@ fn dot_product(_: impl Ctx, vector_a: DVec2, vector_b: DVec2) -> f64 { vector_a.dot(vector_b) } +/// Gets the length or magnitude of a vector. #[node_macro::node(category("Math: Vector"))] fn length(_: impl Ctx, vector: DVec2) -> f64 { vector.length() } +/// Scales the input vector to unit length while preserving it's direction. This is equivalent to dividing the input vector by it's own magnitude. #[node_macro::node(category("Math: Vector"))] fn normalize(_: impl Ctx, vector: DVec2) -> DVec2 { vector.normalize()