![]() |
![]() |
![]() |
hkl Reference Manual | ![]() |
---|---|---|---|---|
Top | Description |
HklMatrix; HklQuaternion; HklVector; void hkl_vector_init (HklVector *self
,double x
,double y
,double z
); void hkl_vector_fprintf (FILE *file
,const HklVector *self
); int hkl_vector_cmp (const HklVector *self
,const HklVector *vector
); int hkl_vector_is_opposite (const HklVector *self
,const HklVector *vector
); void hkl_vector_add_vector (HklVector *self
,const HklVector *vector
); void hkl_vector_minus_vector (HklVector *self
,const HklVector *vector
); void hkl_vector_div_double (HklVector *self
,const double d
); void hkl_vector_times_double (HklVector *self
,const double d
); void hkl_vector_times_vector (HklVector *self
,const HklVector *vector
); void hkl_vector_times_matrix (HklVector *self
,const HklMatrix *m
); double hkl_vector_sum (const HklVector *self
); double hkl_vector_scalar_product (const HklVector *self
,const HklVector *vector
); void hkl_vector_vectorial_product (HklVector *self
,const HklVector *vector
); double hkl_vector_angle (const HklVector *self
,const HklVector *vector
); double hkl_vector_oriented_angle (const HklVector *self
,const HklVector *vector
,const HklVector *ref
); double hkl_vector_norm2 (const HklVector *self
); int hkl_vector_normalize (HklVector *self
); int hkl_vector_is_colinear (const HklVector *self
,const HklVector *vector
); void hkl_vector_randomize (HklVector *self
); void hkl_vector_randomize_vector (HklVector *self
,const HklVector *vector
); void hkl_vector_randomize_vector_vector (HklVector *self
,const HklVector *vector1
,const HklVector *vector2
); void hkl_vector_rotated_around_vector (HklVector *self
,const HklVector *axe
,double angle
); void hkl_vector_rotated_quaternion (HklVector *self
,const HklQuaternion *qr
); int hkl_vector_is_null (const HklVector *self
); void hkl_vector_project_on_plan (HklVector *self
,const HklVector *plan
);
void hkl_vector_init (HklVector *self
,double x
,double y
,double z
);
initialize an HklVector
|
the HklVector to initialize. |
|
the first coordinate value |
|
the second coordinate value |
|
the third coordinate value |
void hkl_vector_fprintf (FILE *file
,const HklVector *self
);
print an HklVector into a stream
|
the stream to print into |
|
the HklVector to print. |
int hkl_vector_cmp (const HklVector *self
,const HklVector *vector
);
compare two HklVector. this comparison use HKL_EPSILON to do the comparison.
|
the first vector |
|
th vector to compare with |
Returns : |
HKL_FALSE if both are equals, HKL_TRUE otherwise. |
int hkl_vector_is_opposite (const HklVector *self
,const HklVector *vector
);
|
|
|
|
Returns : |
void hkl_vector_add_vector (HklVector *self
,const HklVector *vector
);
add an HklVector to another one.
|
the modified HklVector |
|
the hklvector to add |
void hkl_vector_minus_vector (HklVector *self
,const HklVector *vector
);
substract an HklVector to another one.
|
the modified HklVector |
|
the hklvector to substract |
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.
|
the HklVector to modify |
|
the multiply factor |
void hkl_vector_times_vector (HklVector *self
,const HklVector *vector
);
multiply an HklVector by another one. This method multiply coordinate by coordinate.
void hkl_vector_times_matrix (HklVector *self
,const HklMatrix *m
);
|
|
|
double hkl_vector_sum (const HklVector *self
);
compute the HklVector sum of all its elements.
|
the HklVector to sum. |
Returns : |
the sum of all 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_norm2 (const HklVector *self
);
compute the norm2 of an HklVector
|
the hklvector use to compute the norm2 |
Returns : |
the sqrt(|v|) |
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]
|
the HklVector to randomize |
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.
|
the HklVector to rotate |
|
the axe of rotation |
|
the angle of the rotation |
void hkl_vector_rotated_quaternion (HklVector *self
,const HklQuaternion *qr
);
rotate an HklVector using an HklQuaternion.
|
the HklVector to rotate |
|
the HklQuaternion use to rotate the vector |
int hkl_vector_is_null (const HklVector *self
);
check if all the coordinates of an HklVector are null.
|
the hklvector to check |
Returns : |
HKl_TRUE if all |elements| are below HKL_EPSILON, HKl_FALSE otherwise Todo: test |