Top | ![]() |
![]() |
![]() |
![]() |
HklVector * | hkl_vector_dup () |
void | hkl_vector_free () |
void | hkl_vector_init () |
void | hkl_vector_fprintf () |
int | hkl_vector_cmp () |
int | hkl_vector_is_opposite () |
void | hkl_vector_add_vector () |
void | hkl_vector_minus_vector () |
void | hkl_vector_div_double () |
void | hkl_vector_times_double () |
void | hkl_vector_times_vector () |
void | hkl_vector_times_matrix () |
double | hkl_vector_sum () |
double | hkl_vector_scalar_product () |
void | hkl_vector_vectorial_product () |
double | hkl_vector_angle () |
double | hkl_vector_oriented_angle () |
double | hkl_vector_oriented_angle_points () |
double | hkl_vector_norm2 () |
int | hkl_vector_normalize () |
int | hkl_vector_is_colinear () |
void | hkl_vector_randomize () |
void | hkl_vector_randomize_vector () |
void | hkl_vector_randomize_vector_vector () |
void | hkl_vector_rotated_around_vector () |
void | hkl_vector_rotated_quaternion () |
void | hkl_vector_rotated_around_line () |
int | hkl_vector_is_null () |
void | hkl_vector_project_on_plan () |
void | hkl_vector_project_on_plan_with_point () |
void hkl_vector_init (HklVector *self
,double x
,double y
,double z
);
initialize an HklVector
self |
the HklVector to initialize. |
|
x |
the first coordinate value |
|
y |
the second coordinate value |
|
z |
the third coordinate value |
void hkl_vector_fprintf (FILE *file
,const HklVector *self
);
print an HklVector into a stream
int hkl_vector_cmp (const HklVector *self
,const HklVector *vector
);
compare two HklVector. this comparison use HKL_EPSILON to do the comparison.
int hkl_vector_is_opposite (const HklVector *self
,const HklVector *vector
);
Check if two vectors are oposite.
void hkl_vector_add_vector (HklVector *self
,const HklVector *vector
);
add an HklVector to another one.
void hkl_vector_minus_vector (HklVector *self
,const HklVector *vector
);
substract an HklVector to another one.
void hkl_vector_div_double (HklVector *self
,const double d
);
divide an HklVector by constant.
void hkl_vector_times_double (HklVector *self
,const double d
);
multiply an HklVector by a constant value.
void hkl_vector_times_vector (HklVector *self
,const HklVector *vector
);
multiply an HklVector by another one. This method multiply coordinate by coordinate.
double
hkl_vector_sum (const HklVector *self
);
compute the HklVector sum of all its elements.
double hkl_vector_scalar_product (const HklVector *self
,const HklVector *vector
);
compute the scalar product of two HklVector
void hkl_vector_vectorial_product (HklVector *self
,const HklVector *vector
);
compute the vectorial product of two vectors
double hkl_vector_angle (const HklVector *self
,const HklVector *vector
);
compute the angles beetween two HklVector
double hkl_vector_oriented_angle (const HklVector *self
,const HklVector *vector
,const HklVector *ref
);
compute the angles beetween two HklVector and use a reference HklVector to orientate the space. That's way the return value can be in beetween [-pi, pi]. the (self, vector, ref) is a right oriented base.
double hkl_vector_oriented_angle_points (const HklVector *self
,const HklVector *p2
,const HklVector *p3
,const HklVector *ref
);
compute the angles beetween three points (p1, p2, p3) and use a reference HklVector to orientate the space. That's way the return value can be in beetween [-pi, pi]. the (self, vector, ref) is a right oriented base.
double
hkl_vector_norm2 (const HklVector *self
);
compute the norm2 of an HklVector
int hkl_vector_is_colinear (const HklVector *self
,const HklVector *vector
);
check if two HklVector are colinears
void
hkl_vector_randomize (HklVector *self
);
initialize a vector with random values. coordinates range [-1, 1]
void hkl_vector_randomize_vector (HklVector *self
,const HklVector *vector
);
randomize an HklVector an be sure that it is not equal to the HklVector vector.
void hkl_vector_randomize_vector_vector (HklVector *self
,const HklVector *vector1
,const HklVector *vector2
);
randomize an HklVector an be sure that it is not equal to the HklVector vector1 and vector2.
void hkl_vector_rotated_around_vector (HklVector *self
,const HklVector *axe
,double angle
);
rotate a vector around another one with a given angle.
void hkl_vector_rotated_quaternion (HklVector *self
,const HklQuaternion *qr
);
rotate an HklVector using an HklQuaternion.
void hkl_vector_rotated_around_line (HklVector *self
,double angle
,const HklVector *c1
,const HklVector *c2
);
This method rotate a point around a line defined by two points of a certain amount of angle. The rotation is right handed. this mean that c2 - c1 gives the direction of the rotation.
int
hkl_vector_is_null (const HklVector *self
);
check if all the coordinates of an HklVector are null.
void hkl_vector_project_on_plan (HklVector *self
,const HklVector *normal
);
project an HklVector on a plan of normal which contain the origin [0, 0, 0]