manpagez: man pages & more
info mathgl_en
Home | html | info | man
[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

8.2 mglPoint class

Structure describes point in space. This structure is defined in #include <mgl2/type.h>

Parameter of mglPoint: float x, y, z, c

Point coordinates {x,y,z} and one extra value c used for amplitude, transparency and so on. By default all values are zero.

Method on mglPoint: mglPoint (float X=0, float Y=0, float Z=0, float C=0)

Constructor sets the color by float values of Red, Green, Blue and Alpha channels. These values should be in interval [0,1].

Method on mglPoint: bool IsNAN ()

Returns true if point contain NAN values.

Method on mglPoint: float norm ()

Returns the norm \sqrt{x^2+y^2+z^2} of vector.

Method on mglPoint: void Normalize ()

Normalizes vector to be unit vector.

Method on mglPoint: float val (int i)

Returns point component: x for i=0, y for i=1, z for i=2, c for i=3.

Library Function: mglPoint operator+ (const mglPoint &a, const mglPoint &b)

Point of summation (summation of vectors).

Library Function: mglPoint operator- (const mglPoint &a, const mglPoint &b)

Point of difference (difference of vectors).

Library Function: mglPoint operator* (float a, const mglPoint &b)
Library Function: mglPoint operator* (const mglPoint &a, float b)

Multiplies (scale) points by number.

Library Function: mglPoint operator/ (const mglPoint &a, float b)

Multiplies (scale) points by number 1/b.

Library Function: float operator* (const mglPoint &a, const mglPoint &b)

Scalar product of vectors.

Library Function: mglPoint operator/ (const mglPoint &a, const mglPoint &b)

Return vector of element-by-element product.

Library Function: mglPoint operator^ (const mglPoint &a, const mglPoint &b)

Cross-product of vectors.

Library Function: mglPoint operator& (const mglPoint &a, const mglPoint &b)

The part of a which is perpendicular to vector b.

Library Function: mglPoint operator| (const mglPoint &a, const mglPoint &b)

The part of a which is parallel to vector b.

Library Function: mglPoint operator! (const mglPoint &a)

Return vector perpendicular to vector a.

Library Function: float mgl_norm (const mglPoint &a)

Return the norm sqrt(|a|^2) of vector a.

Library Function: bool operator== (const mglPoint &a, const mglPoint &b)

Return true if points are the same.

Library Function: bool operator!= (const mglPoint &a, const mglPoint &b)

Return true if points are different.


[ << ] [ < ] [ Up ] [ > ] [ >> ]         [Top] [Contents] [Index] [ ? ]

This document was generated on April 13, 2012 using texi2html 5.0.

© manpagez.com 2000-2025
Individual documents may contain additional copyright information.