From 80cb6bfbbf152075b08a012807ff951943f3ab54 Mon Sep 17 00:00:00 2001 From: shiffman Date: Fri, 15 Jun 2012 17:32:12 +0000 Subject: [PATCH] working on comments for reference --- core/src/processing/core/PVector.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/core/src/processing/core/PVector.java b/core/src/processing/core/PVector.java index 3710a0761..1a7589933 100644 --- a/core/src/processing/core/PVector.java +++ b/core/src/processing/core/PVector.java @@ -834,7 +834,25 @@ public class PVector implements Serializable { return -1*angle; } + + * @webref pvector:method + * @usage web_application + * @brief Normalize the vector to a length of 1 + */ + public void normalize() { + float m = mag(); + if (m != 0 && m != 1) { + div(m); + } + } + /** + * ( begin auto-generated from PVector_rotate.xml ) + * + * Normalize the vector to length 1 (make it a unit vector). + * + * ( end auto-generated ) + * * Rotate the vector by an angle (only 2D vectors), magnitude remains the same * @param theta the angle of rotation */