Home | History | Annotate | Download | only in dist

Lines Matching defs:vec2

126  * @name vec2
129 var vec2 = {};
132 * Creates a new, empty vec2
134 * @returns {vec2} a new 2D vector
136 vec2.create = function() {
144 * Creates a new vec2 initialized with values from an existing vector
146 * @param {vec2} a vector to clone
147 * @returns {vec2} a new 2D vector
149 vec2.clone = function(a) {
157 * Creates a new vec2 initialized with the given values
161 * @returns {vec2} a new 2D vector
163 vec2.fromValues = function(x, y) {
171 * Copy the values from one vec2 to another
173 * @param {vec2} out the receiving vector
174 * @param {vec2} a the source vector
175 * @returns {vec2} out
177 vec2.copy = function(out, a) {
184 * Set the components of a vec2 to the given values
186 * @param {vec2} out the receiving vector
189 * @returns {vec2} out
191 vec2.set = function(out, x, y) {
198 * Adds two vec2's
200 * @param {vec2} out the receiving vector
201 * @param {vec2} a the first operand
202 * @param {vec2} b the second operand
203 * @returns {vec2} out
205 vec2.add = function(out, a, b) {
212 * Subtracts two vec2's
214 * @param {vec2} out the receiving vector
215 * @param {vec2} a the first operand
216 * @param {vec2} b the second operand
217 * @returns {vec2} out
219 vec2.subtract = function(out, a, b) {
226 * Alias for {@link vec2.subtract}
229 vec2.sub = vec2.subtract;
232 * Multiplies two vec2's
234 * @param {vec2} out the receiving vector
235 * @param {vec2} a the first operand
236 * @param {vec2} b the second operand
237 * @returns {vec2} out
239 vec2.multiply = function(out, a, b) {
246 * Alias for {@link vec2.multiply}
249 vec2.mul = vec2.multiply;
252 * Divides two vec2's
254 * @param {vec2} out the receiving vector
255 * @param {vec2} a the first operand
256 * @param {vec2} b the second operand
257 * @returns {vec2} out
259 vec2.divide = function(out, a, b) {
266 * Alias for {@link vec2.divide}
269 vec2.div = vec2.divide;
272 * Returns the minimum of two vec2's
274 * @param {vec2} out the receiving vector
275 * @param {vec2} a the first operand
276 * @param {vec2} b the second operand
277 * @returns {vec2} out
279 vec2.min = function(out, a, b) {
286 * Returns the maximum of two vec2's
288 * @param {vec2} out the receiving vector
289 * @param {vec2} a the first operand
290 * @param {vec2} b the second operand
291 * @returns {vec2} out
293 vec2.max = function(out, a, b) {
300 * Scales a vec2 by a scalar number
302 * @param {vec2} out the receiving vector
303 * @param {vec2} a the vector to scale
305 * @returns {vec2} out
307 vec2.scale = function(out, a, b) {
314 * Calculates the euclidian distance between two vec2's
316 * @param {vec2} a the first operand
317 * @param {vec2} b the second operand
320 vec2.distance = function(a, b) {
327 * Alias for {@link vec2.distance}
330 vec2.dist = vec2.distance;
333 * Calculates the squared euclidian distance between two vec2's
335 * @param {vec2} a the first operand
336 * @param {vec2} b the second operand
339 vec2.squaredDistance = function(a, b) {
346 * Alias for {@link vec2.squaredDistance}
349 vec2.sqrDist = vec2.squaredDistance;
352 * Calculates the length of a vec2
354 * @param {vec2} a vector to calculate length of
357 vec2.length = function (a) {
364 * Alias for {@link vec2.length}
367 vec2.len = vec2.length;
370 * Calculates the squared length of a vec2
372 * @param {vec2} a vector to calculate squared length of
375 vec2.squaredLength = function (a) {
382 * Alias for {@link vec2.squaredLength}
385 vec2.sqrLen = vec2.squaredLength;
388 * Negates the components of a vec2
390 * @param {vec2} out the receiving vector
391 * @param {vec2} a vector to negate
392 * @returns {vec2} out
394 vec2.negate = function(out, a) {
401 * Normalize a vec2
403 * @param {vec2} out the receiving vector
404 * @param {vec2} a vector to normalize
405 * @returns {vec2} out
407 vec2.normalize = function(out, a) {
421 * Calculates the dot product of two vec2's
423 * @param {vec2} a the first operand
424 * @param {vec2} b the second operand
427 vec2.dot = function (a, b) {
432 * Computes the cross product of two vec2's
436 * @param {vec2} a the first operand
437 * @param {vec2} b the second operand
440 vec2.cross = function(out, a, b) {
448 * Performs a linear interpolation between two vec2's
450 * @param {vec2} out the receiving vector
451 * @param {vec2} a the first operand
452 * @param {vec2} b the second operand
454 * @returns {vec2} out
456 vec2.lerp = function (out, a, b, t) {
465 * Transforms the vec2 with a mat2
467 * @param {vec2} out the receiving vector
468 * @param {vec2} a the vector to transform
470 * @returns {vec2} out
472 vec2.transformMat2 = function(out, a, m) {
481 * Transforms the vec2 with a mat2d
483 * @param {vec2} out the receiving vector
484 * @param {vec2} a the vector to transform
486 * @returns {vec2} out
488 vec2.transformMat2d = function(out, a, m) {
497 * Transforms the vec2 with a mat3
500 * @param {vec2} out the receiving vector
501 * @param {vec2} a the vector to transform
503 * @returns {vec2} out
505 vec2.transformMat3 = function(out, a, m) {
514 * Transforms the vec2 with a mat4
518 * @param {vec2} out the receiving vector
519 * @param {vec2} a the vector to transform
521 * @returns {vec2} out
523 vec2.transformMat4 = function(out, a, m) {
535 * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed
543 vec2.forEach = (function() {
544 var vec = vec2.create();
575 * @param {vec2} vec vector to represent as a string
578 vec2.str = function (a) {
579 return 'vec2(' + a[0] + ', ' + a[1] + ')';
583 exports.vec2 = vec2;
1766 * Scales the mat2 by the dimensions in the given vec2
1770 * @param {vec2} v the vec2 to scale the matrix by
2001 * Scales the mat2d by the dimensions in the given vec2
2005 * @param {mat2d} v the vec2 to scale the matrix by
2020 * Translates the mat2d by the dimensions in the given vec2
2024 * @param {mat2d} v the vec2 to translate the matrix by
2327 * @param {vec2} v vector to translate by
2381 * Scales the mat3 by the dimensions in the given vec2
2385 * @param {vec2} v the vec2 to scale the matrix by
2410 * @param {vec2} v the vec2 to scale the matrix by