89#if defined(__cplusplus)
93 return a_vector3_set_dir(
this, x_, y_, z_);
97 a_vector3_val(
this, &x_, &y_, &z_);
101 a_vector3_set_val(
this, x_, y_, z_);
105 a_vector3_pol(
this, &rho, &theta, &z_);
109 a_vector3_set_pol(
this, rho, theta, z_);
113 a_vector3_sph(
this, &rho, &theta, &alpha);
117 a_vector3_set_sph(
this, rho, theta, alpha);
121 a_vector3_add(
this, &rhs, &res);
125 a_vector3_sub(
this, &rhs, &res);
129 a_vector3_mul(
this, rhs, &res);
133 a_vector3_div(
this, rhs, &res);
137 a_vector3_neg(
this, &res);
139 A_INLINE
a_real unit() {
return a_vector3_unit(
this); }
140 A_INLINE
a_real norm()
const {
return a_vector3_norm(
this); }
141 A_INLINE
a_real norm1()
const {
return a_vector3_norm1(
this); }
142 A_INLINE
a_real norm2()
const {
return a_vector3_norm2(
this); }
143 A_INLINE
a_real dot(
a_vector3 const &rhs)
const {
return a_vector3_dot(
this, &rhs); }
144 A_INLINE
a_real dist(
a_vector3 const &rhs)
const {
return a_vector3_dist(
this, &rhs); }
145 A_INLINE
a_real dist1(
a_vector3 const &rhs)
const {
return a_vector3_dist1(
this, &rhs); }
146 A_INLINE
a_real dist2(
a_vector3 const &rhs)
const {
return a_vector3_dist2(
this, &rhs); }
147 A_INLINE
a_real angle(
a_vector3 const &rhs)
const {
return a_vector3_angle(
this, &rhs); }
148 A_INLINE
a_bool isver(
a_vector3 const &rhs)
const {
return a_vector3_isver(
this, &rhs); }
149 A_INLINE
a_bool ispar(
a_vector3 const &rhs)
const {
return a_vector3_ispar(
this, &rhs); }
152 a_vector3_cross(
this, &rhs, &res);
156 a_vector3_outer(
this, &rhs, res);
160 return a_vector3_ortho(
this, &u, &v);
164 a_vector3_rot(
this, &dir, angle, &res);
169 a_vector3_rot2d(&iu, &iv, angle, &ou, &ov);
174 a_vector3_cross(&lhs, &rhs, &res);
177 friend A_INLINE
void operator+=(
a_vector3 &lhs,
a_vector3 const &rhs) { a_vector3_add(&lhs, &rhs, &lhs); }
181 a_vector3_add(&lhs, &rhs, &res);
184 friend A_INLINE
void operator-=(
a_vector3 &lhs,
a_vector3 const &rhs) { a_vector3_sub(&lhs, &rhs, &lhs); }
188 a_vector3_sub(&lhs, &rhs, &res);
191 friend A_INLINE
void operator*=(
a_vector3 &lhs,
a_real rhs) { a_vector3_mul(&lhs, rhs, &lhs); }
194 return a_vector3_dot(&lhs, &rhs);
199 a_vector3_mul(&rhs, lhs, &res);
205 a_vector3_mul(&lhs, rhs, &res);
208 friend A_INLINE
void operator/=(
a_vector3 &lhs,
a_real rhs) { a_vector3_div(&lhs, rhs, &lhs); }
212 a_vector3_div(&lhs, rhs, &res);
219 a_vector3_neg(&rhs, &res);
252 a_real_cart2pol(ctx->x, ctx->y, rho, theta);
257 a_real_pol2cart(rho, theta, &ctx->x, &ctx->y);
262 a_real_cart2sph(ctx->x, ctx->y, ctx->z, rho, theta, alpha);
266 a_real_sph2cart(rho, theta, alpha, &ctx->x, &ctx->y, &ctx->z);