cls_BasePoints - almarklein/visvis GitHub Wiki
Inherits from object.
Abstract class for the Point and Pointset classes. It defines addition, substraction, multiplication and devision for points and pointsets, and it implements some mathematical methods.
The BasePoints class implements the following properties:
data, ndim
The BasePoints class implements the following methods:
angle, angle2, copy, cross, distance, dot, norm, normal, normalize, subtract
Get the internal numpy array.
Get the number of dimensions.
Calculate the angle (in radians) between two vectors. For 2D uses the arctan2 method so the angle has a sign. For 3D the angle is the smallest angles between the two vectors.
If no point is given, the angle is calculated relative to the positive x-axis.
Calculate the angle (in radians) of the vector between two points.
Notes
Say we have p1=(3,4) and p2=(2,1).
p1.angle(p2) returns the difference of the angles of the two vectors: 0.142 = 0.927 - 0.785
p1.angle2(p2) returns the angle of the difference vector (1,3): p1.angle2(p2) == (p1-p2).angle()
Make a copy of the point or pointset.
Calculate the cross product of two 3D vectors.
Given two vectors, returns the vector that is orthogonal to both vectors. The right hand rule is applied; this vector is the middle finger, the argument the index finger, the returned vector points in the direction of the thumb.
Calculate the Euclidian distance between two points or pointsets. Use norm() to calculate the length of a vector.
Calculate the dot product of the two points or pointsets. The dot producet is the standard inner product of the orthonormal Euclidean space.
Calculate the norm (length) of the vector. This is the same as the distance to point 0,0 or 0,0,0, but implemented a bit faster.
Calculate the normalized normal of a vector. Use (p1-p2).normal() to calculate the normal of the line p1-p2. Only works on 2D points. For 3D points use cross().
Return normalized vector (to unit length).
Subtract Pointset/Point instances.
Notes
This method was introduced because of the minus-bug. To get the same behaviour of when the bug was still there, replace "A-B" with B.subtract(A).