IGLib
1.7.2
The IGLib base library for development of numerical, technical and business applications.
|
3D vector, struct implementation. More...
Public Member Functions | |
vec3 (vec3 v) | |
Copy constructor. Initializes components of a 3D vector with components of the specified vector. More... | |
vec3 (double x, double y, double z) | |
Initializes components of a 3D vector with the specified values. More... | |
vec3 (double comp) | |
Initializes all component of a 3D vector with the specified value. More... | |
void | Zero () |
Sets components of the vector to 0.0. More... | |
void | Set (double comp) |
Sets components of the vector to the specified value. More... | |
override int | GetHashCode () |
Returns the hashRet code (hashRet function) of the current vector. More... | |
override bool | Equals (Object obj) |
Returns a value indicating whether the specified object is equal to the current vector. More... | |
vec3 | Normalized () |
Returns normalized this 3D vector. More... | |
vec3 | Normalized1 () |
Returns normalized this 3D vector in 1 norm. More... | |
vec3 | Normalized2 () |
Returns normalized this 3D vector in 2 norm. More... | |
vec3 | NormalizedInfinity () |
Returns normalized this 3D vector in infinity norm. More... | |
double | ScalarProduct (vec3 v) |
Returns scalar product of the current and the specified vector. More... | |
vec3 | VectorProduct (vec3 v) |
Returns vector product of the current and the specified vector. More... | |
vec3 | CrossProduct (vec3 v) |
Returns vector product of the current and the specified vector. More... | |
vec3 | Cross (vec3 v) |
Returns vector product of the current and the specified vector. More... | |
mat3 | DyadicProduct (vec3 v) |
Returns dyadic product of the current and the specified vector. More... | |
double | MixedProduct (vec3 b, vec3 c) |
Returns mixed product of the current and two other specified vectors. This equals the volume of the parallelepiped spanned by these vectors. More... | |
vec3 | Multiply (double k) |
Returns the current vector multiplied by the specified scalar. More... | |
vec3 | Add (vec3 a) |
Returns sum of the current vector and the specified vector. More... | |
vec3 | Subtract (vec3 a) |
Returns difference between the current vector and the specified vector. More... | |
override string | ToString () |
Returns string representation of the 3D vector. More... | |
void | Read () |
Reads 3D vector components from a console. More... | |
void | Read (string name) |
Reads 3D vector components from a console. More... | |
Static Public Member Functions | |
static vec3 | Copy (vec3 v) |
Returns a copy of the specified 3D vector. More... | |
static void | Negate (vec3 v, ref vec3 res) |
Negates the specified vector and stores its copy in the resulting vector. More... | |
static vec3 | operator+ (vec3 v) |
Unary plus, returns the operand. More... | |
static vec3 | operator- (vec3 v) |
Unary negation, returns the negative operand. More... | |
static vec3 | operator+ (vec3 a, vec3 b) |
Vector addition. More... | |
static vec3 | operator- (vec3 a, vec3 b) |
Vector subtraction. More... | |
static double | operator* (vec3 a, vec3 b) |
Scalar product of two 3D vectors. More... | |
static vec3 | operator* (vec3 a, double b) |
Product of a 3D vector by a scalar. More... | |
static vec3 | operator* (double a, vec3 b) |
Product of a 3D vector by a scalar. More... | |
static vec3 | operator/ (vec3 a, double b) |
Vector subtraction. More... | |
static bool | operator== (vec3 a, vec3 b) |
Vector comparison. More... | |
static bool | operator!= (vec3 a, vec3 b) |
Vector comparison, returns true if vectors are different. More... | |
Public Attributes | |
double | x |
double | y |
double | z |
Properties | |
double | this[int i] [get, set] |
Index operator. More... | |
double | Norm [get] |
Gets a 2 norm of the current 3D vector. More... | |
double | Norm2 [get] |
Gets a 2 norm of the current 3D vector. More... | |
double | Norm1 [get] |
Gets an 1 norm of the current 3D vector - sum of absolute values of components. More... | |
double | NormInf [get] |
Gets an infinity norm of the current 3D vector - maximal absolute component value. More... | |
3D vector, struct implementation.
Name of this struct is not in line with conventions. This is intentional in order to prevent mistaking struct implementation for class interpretation.
$A Igor Jul08; Oct10;
|
inline |
Copy constructor. Initializes components of a 3D vector with components of the specified vector.
v | Vectr whose components are copied to the initialized vector. |
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
|
inline |
Initializes components of a 3D vector with the specified values.
x | Value to be assigned to the 1st element of the vector. |
y | Value to be assigned to the 2nd element of the vector. |
z | Value to be assigned to the 3rd element of the vector. |
|
inline |
Initializes all component of a 3D vector with the specified value.
comp | Value assigned to all vector elements. |
|
inline |
Sets components of the vector to 0.0.
|
inline |
Sets components of the vector to the specified value.
|
inline |
Returns the hashRet code (hashRet function) of the current vector.
This method should be consistent with the VectorBase.GetHashCode() method, which is standard for implementations of the IVector interface.
Two vectors that have equal all elements will produce the same hashRet codes.
Probability that two different vectors will produce the same hashRet code is small but it exists.
Overrides the object.GetHashCode method.
|
inline |
Returns a value indicating whether the specified object is equal to the current vector.
True is returned if the object is of type vec3) and has equal elements as the current vector.
Overrides the object.Equals(object) method.
|
inline |
Returns normalized this 3D vector.
|
inline |
Returns normalized this 3D vector in 1 norm.
|
inline |
Returns normalized this 3D vector in 2 norm.
|
inline |
Returns normalized this 3D vector in infinity norm.
|
inline |
Returns scalar product of the current and the specified vector.
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
Referenced by IG.Num.vec3.operator*().
Returns vector product of the current and the specified vector.
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
Returns vector product of the current and the specified vector.
Returns vector product of the current and the specified vector.
Returns dyadic product of the current and the specified vector.
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
Returns mixed product of the current and two other specified vectors. This equals the volume of the parallelepiped spanned by these vectors.
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
|
inline |
Returns the current vector multiplied by the specified scalar.
k | Factor by which the current vector is multiplied. |
Referenced by IG.Num.vec3.operator*().
Returns sum of the current vector and the specified vector.
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
Referenced by IG.Num.vec3.operator+().
Returns difference between the current vector and the specified vector.
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
Referenced by IG.Num.vec3.operator-().
Returns a copy of the specified 3D vector.
v | Vector whose copy is returned. |
Referenced by IG.Num.vec3.operator+().
Negates the specified vector and stores its copy in the resulting vector.
v | Vectr to be negated. |
res | Vector where the result is stored. |
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
Unary plus, returns the operand.
References IG.Num.vec3.Copy().
Unary negation, returns the negative operand.
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
Vector addition.
References IG.Num.vec3.Add().
Vector subtraction.
References IG.Num.vec3.Subtract().
Scalar product of two 3D vectors.
References IG.Num.vec3.ScalarProduct().
Product of a 3D vector by a scalar.
References IG.Num.vec3.Multiply().
Product of a 3D vector by a scalar.
References IG.Num.vec3.Multiply().
Vector subtraction.
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
Vector comparison.
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
Vector comparison, returns true if vectors are different.
References IG.Num.vec3.x, IG.Num.vec3.y, and IG.Num.vec3.z.
|
inline |
Returns string representation of the 3D vector.
Referenced by IG.Gr3d.Graph3dManipulator.UpdateTextFields().
|
inline |
Reads 3D vector components from a console.
Referenced by IG.Num.mat3.Example().
|
inline |
Reads 3D vector components from a console.
name | Name of the vector to be read; it is written as orientation to the user and can be null. |
References IG.Lib.UtilConsole.Read().
double IG.Num.vec3.x |
Referenced by IG.Num.vec3.Add(), IG.Gr3d.VtkSurfacePlotBase.AddFilledQuadrilateral(), IG.Gr3d.VtkSurfacePlotBase.AddFilledTriangle(), IG.Gr3d.VtkSurfacePlotBase.AddLine(), IG.Gr3d.VtkSurfacePlotBase.AddPoint(), IG.Gr3d.VtkSurfacePlotBase.AddQuadrilateral(), IG.Gr3d.VtkSurfacePlotBase.AddTriangle(), IG.Gr3d.VtkPlotter.CalculateScalingParameters(), IG.Gr3d.VtkCurvePlot.Create(), IG.Gr3d.VtkSurfacePlot.Create(), IG.Num.vec3.DyadicProduct(), IG.Num.Func3dBase.Gradient(), IG.Num.Func3dVectorFormBase.Gradient(), IG.Num.Func3dBase.Hessian(), IG.Num.Field< TElement >.MapCoordinates1dPlain(), IG.Num.StructuredField2d< TElement >.MapCoordinatesReferencePlain(), IG.Num.mat3.mat3(), IG.Num.vec3.MixedProduct(), IG.Num.mat3.Multiply(), IG.Num.vec3.Negate(), IG.Num.vec3.operator!=(), IG.Num.vec3.operator-(), IG.Num.vec3.operator/(), IG.Num.vec3.operator==(), IG.Gr3d.VtkSurfacePlot.PrepareRandomMesh(), IG.Num.vec3.ScalarProduct(), IG.Gr3d.VtkPlotter.ScaleActorPlain(), IG.Num.vec3.Subtract(), IG.Gr3d.Graph3dManipulator.txtR_Validated(), IG.Num.BoundingBox3d.Update(), IG.Num.Field< TElement >.UpdateBounds(), IG.Gr3d.Graph3dManipulator.UpdateTextFields(), IG.Num.Func3dBase.Value(), IG.Num.vec3.vec3(), IG.Num.Vector3d.Vector3d(), and IG.Num.vec3.VectorProduct().
double IG.Num.vec3.y |
Referenced by IG.Num.vec3.Add(), IG.Gr3d.VtkSurfacePlotBase.AddFilledQuadrilateral(), IG.Gr3d.VtkSurfacePlotBase.AddFilledTriangle(), IG.Gr3d.VtkSurfacePlotBase.AddLine(), IG.Gr3d.VtkSurfacePlotBase.AddPoint(), IG.Gr3d.VtkSurfacePlotBase.AddQuadrilateral(), IG.Gr3d.VtkSurfacePlotBase.AddTriangle(), IG.Gr3d.VtkPlotter.CalculateScalingParameters(), IG.Gr3d.VtkCurvePlot.Create(), IG.Gr3d.VtkSurfacePlot.Create(), IG.Num.vec3.DyadicProduct(), IG.Num.Func3dBase.Gradient(), IG.Num.Func3dVectorFormBase.Gradient(), IG.Num.Func3dBase.Hessian(), IG.Num.StructuredField2d< TElement >.MapCoordinatesReferencePlain(), IG.Num.mat3.mat3(), IG.Num.vec3.MixedProduct(), IG.Num.mat3.Multiply(), IG.Num.vec3.Negate(), IG.Num.vec3.operator!=(), IG.Num.vec3.operator-(), IG.Num.vec3.operator/(), IG.Num.vec3.operator==(), IG.Gr3d.VtkSurfacePlot.PrepareRandomMesh(), IG.Gr3d.VtkControlBase.RotateAzimuth(), IG.Num.vec3.ScalarProduct(), IG.Gr3d.VtkPlotter.ScaleActorPlain(), IG.Num.vec3.Subtract(), IG.Gr3d.Graph3dManipulator.txtFi_Validated(), IG.Num.BoundingBox3d.Update(), IG.Num.Field< TElement >.UpdateBounds(), IG.Gr3d.Graph3dManipulator.UpdateTextFields(), IG.Num.Func3dBase.Value(), IG.Num.vec3.vec3(), IG.Num.Vector3d.Vector3d(), and IG.Num.vec3.VectorProduct().
double IG.Num.vec3.z |
Referenced by IG.Num.vec3.Add(), IG.Gr3d.VtkSurfacePlotBase.AddFilledQuadrilateral(), IG.Gr3d.VtkSurfacePlotBase.AddFilledTriangle(), IG.Gr3d.VtkSurfacePlotBase.AddLine(), IG.Gr3d.VtkSurfacePlotBase.AddPoint(), IG.Gr3d.VtkSurfacePlotBase.AddQuadrilateral(), IG.Gr3d.VtkSurfacePlotBase.AddTriangle(), IG.Gr3d.VtkPlotter.CalculateScalingParameters(), IG.Gr3d.VtkCurvePlot.Create(), IG.Gr3d.VtkSurfacePlot.Create(), IG.Num.vec3.DyadicProduct(), IG.Num.Func3dBase.Gradient(), IG.Num.Func3dVectorFormBase.Gradient(), IG.Num.Func3dBase.Hessian(), IG.Num.mat3.mat3(), IG.Num.vec3.MixedProduct(), IG.Num.mat3.Multiply(), IG.Num.vec3.Negate(), IG.Num.vec3.operator!=(), IG.Num.vec3.operator-(), IG.Num.vec3.operator/(), IG.Num.vec3.operator==(), IG.Gr3d.VtkSurfacePlot.PrepareRandomMesh(), IG.Gr3d.VtkControlBase.RotatePitch(), IG.Num.vec3.ScalarProduct(), IG.Gr3d.VtkPlotter.ScaleActorPlain(), IG.Num.vec3.Subtract(), IG.Gr3d.Graph3dManipulator.txtTheta_Validated(), IG.Num.BoundingBox3d.Update(), IG.Num.Field< TElement >.UpdateBounds(), IG.Gr3d.Graph3dManipulator.UpdateTextFields(), IG.Num.Func3dBase.Value(), IG.Num.vec3.vec3(), IG.Num.Vector3d.Vector3d(), and IG.Num.vec3.VectorProduct().
|
getset |
Index operator.
i | Component index. |
|
get |
Gets a 2 norm of the current 3D vector.
|
get |
Gets a 2 norm of the current 3D vector.
|
get |
Gets an 1 norm of the current 3D vector - sum of absolute values of components.
|
get |
Gets an infinity norm of the current 3D vector - maximal absolute component value.