Blender  V2.93
Macros | Functions
math_vector.c File Reference
#include "BLI_math.h"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Macros

#define SWAP_AXIS(a, b)
 

Functions

void interp_v2_v2v2 (float r[2], const float a[2], const float b[2], const float t)
 
void interp_v2_v2v2v2 (float r[2], const float a[2], const float b[2], const float c[2], const float t[3])
 
void interp_v3_v3v3 (float r[3], const float a[3], const float b[3], const float t)
 
void interp_v4_v4v4 (float r[4], const float a[4], const float b[4], const float t)
 
bool interp_v3_v3v3_slerp (float target[3], const float a[3], const float b[3], const float t)
 
bool interp_v2_v2v2_slerp (float target[2], const float a[2], const float b[2], const float t)
 
void interp_v3_v3v3_slerp_safe (float target[3], const float a[3], const float b[3], const float t)
 
void interp_v2_v2v2_slerp_safe (float target[2], const float a[2], const float b[2], const float t)
 
void interp_v3_v3v3v3 (float p[3], const float v1[3], const float v2[3], const float v3[3], const float w[3])
 
void interp_v3_v3v3v3v3 (float p[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3], const float w[4])
 
void interp_v4_v4v4v4 (float p[4], const float v1[4], const float v2[4], const float v3[4], const float w[3])
 
void interp_v4_v4v4v4v4 (float p[4], const float v1[4], const float v2[4], const float v3[4], const float v4[4], const float w[4])
 
void interp_v3_v3v3v3_uv (float p[3], const float v1[3], const float v2[3], const float v3[3], const float uv[2])
 
void interp_v3_v3v3_uchar (uchar target[3], const uchar a[3], const uchar b[3], const float t)
 
void interp_v3_v3v3_char (char target[3], const char a[3], const char b[3], const float t)
 
void interp_v4_v4v4_uchar (uchar target[4], const uchar a[4], const uchar b[4], const float t)
 
void interp_v4_v4v4_char (char target[4], const char a[4], const char b[4], const float t)
 
void mid_v3_v3v3 (float r[3], const float a[3], const float b[3])
 
void mid_v2_v2v2 (float r[2], const float a[2], const float b[2])
 
void mid_v2_v2v2v2 (float v[2], const float v1[2], const float v2[2], const float v3[2])
 
void mid_v3_v3v3v3 (float v[3], const float v1[3], const float v2[3], const float v3[3])
 
void mid_v3_v3v3v3v3 (float v[3], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
 
void mid_v3_v3_array (float r[3], const float(*vec_arr)[3], const uint nbr)
 
void mid_v3_v3v3_angle_weighted (float r[3], const float a[3], const float b[3])
 
void mid_v3_angle_weighted (float r[3])
 
void flip_v4_v4v4 (float v[4], const float v1[4], const float v2[4])
 
void flip_v3_v3v3 (float v[3], const float v1[3], const float v2[3])
 
void flip_v2_v2v2 (float v[2], const float v1[2], const float v2[2])
 
bool is_finite_v2 (const float v[2])
 
bool is_finite_v3 (const float v[3])
 
bool is_finite_v4 (const float v[4])
 
float angle_v3v3v3 (const float a[3], const float b[3], const float c[3])
 
float cos_v3v3v3 (const float p1[3], const float p2[3], const float p3[3])
 
float angle_v3v3 (const float a[3], const float b[3])
 
float angle_v2v2v2 (const float a[2], const float b[2], const float c[2])
 
float cos_v2v2v2 (const float p1[2], const float p2[2], const float p3[2])
 
float angle_v2v2 (const float a[2], const float b[2])
 
float angle_signed_v2v2 (const float v1[2], const float v2[2])
 
float angle_normalized_v3v3 (const float v1[3], const float v2[3])
 
float angle_normalized_v2v2 (const float a[2], const float b[2])
 
float angle_on_axis_v3v3_v3 (const float v1[3], const float v2[3], const float axis[3])
 
float angle_signed_on_axis_v3v3_v3 (const float v1[3], const float v2[3], const float axis[3])
 
float angle_on_axis_v3v3v3_v3 (const float v1[3], const float v2[3], const float v3[3], const float axis[3])
 
float angle_signed_on_axis_v3v3v3_v3 (const float v1[3], const float v2[3], const float v3[3], const float axis[3])
 
void angle_tri_v3 (float angles[3], const float v1[3], const float v2[3], const float v3[3])
 
void angle_quad_v3 (float angles[4], const float v1[3], const float v2[3], const float v3[3], const float v4[3])
 
void angle_poly_v3 (float *angles, const float *verts[3], int len)
 
void project_v2_v2v2 (float out[2], const float p[2], const float v_proj[2])
 
void project_v3_v3v3 (float out[3], const float p[3], const float v_proj[3])
 
void project_v3_v3v3_db (double out[3], const double p[3], const double v_proj[3])
 
void project_v2_v2v2_normalized (float out[2], const float p[2], const float v_proj[2])
 
void project_v3_v3v3_normalized (float out[3], const float p[3], const float v_proj[3])
 
void project_plane_v3_v3v3 (float out[3], const float p[3], const float v_plane[3])
 
void project_plane_v2_v2v2 (float out[2], const float p[2], const float v_plane[2])
 
void project_plane_normalized_v3_v3v3 (float out[3], const float p[3], const float v_plane[3])
 
void project_plane_normalized_v2_v2v2 (float out[2], const float p[2], const float v_plane[2])
 
void project_v3_plane (float out[3], const float plane_no[3], const float plane_co[3])
 
void bisect_v3_v3v3v3 (float r[3], const float a[3], const float b[3], const float c[3])
 
void reflect_v3_v3v3 (float out[3], const float v[3], const float normal[3])
 
void reflect_v3_v3v3_db (double out[3], const double v[3], const double normal[3])
 
void ortho_basis_v3v3_v3 (float r_n1[3], float r_n2[3], const float n[3])
 
void ortho_v3_v3 (float out[3], const float v[3])
 
void ortho_v2_v2 (float out[2], const float v[2])
 
void rotate_v2_v2fl (float r[2], const float p[2], const float angle)
 
void rotate_normalized_v3_v3v3fl (float out[3], const float p[3], const float axis[3], const float angle)
 
void rotate_v3_v3v3fl (float r[3], const float p[3], const float axis[3], const float angle)
 
void print_v2 (const char *str, const float v[2])
 
void print_v3 (const char *str, const float v[3])
 
void print_v4 (const char *str, const float v[4])
 
void print_vn (const char *str, const float v[], const int n)
 
void minmax_v4v4_v4 (float min[4], float max[4], const float vec[4])
 
void minmax_v3v3_v3 (float min[3], float max[3], const float vec[3])
 
void minmax_v2v2_v2 (float min[2], float max[2], const float vec[2])
 
void minmax_v3v3_v3_array (float r_min[3], float r_max[3], const float(*vec_arr)[3], int nbr)
 
void dist_ensure_v3_v3fl (float v1[3], const float v2[3], const float dist)
 
void dist_ensure_v2_v2fl (float v1[2], const float v2[2], const float dist)
 
void axis_sort_v3 (const float axis_values[3], int r_axis_order[3])
 
MINLINE double sqr_db (double f)
 
double dot_vn_vn (const float *array_src_a, const float *array_src_b, const int size)
 
double len_squared_vn (const float *array, const int size)
 
float normalize_vn_vn (float *array_tar, const float *array_src, const int size)
 
float normalize_vn (float *array_tar, const int size)
 
void range_vn_i (int *array_tar, const int size, const int start)
 
void range_vn_u (uint *array_tar, const int size, const uint start)
 
void range_vn_fl (float *array_tar, const int size, const float start, const float step)
 
void negate_vn (float *array_tar, const int size)
 
void negate_vn_vn (float *array_tar, const float *array_src, const int size)
 
void mul_vn_vn (float *array_tar, const float *array_src, const int size)
 
void mul_vn_vnvn (float *array_tar, const float *array_src_a, const float *array_src_b, const int size)
 
void mul_vn_fl (float *array_tar, const int size, const float f)
 
void mul_vn_vn_fl (float *array_tar, const float *array_src, const int size, const float f)
 
void add_vn_vn (float *array_tar, const float *array_src, const int size)
 
void add_vn_vnvn (float *array_tar, const float *array_src_a, const float *array_src_b, const int size)
 
void madd_vn_vn (float *array_tar, const float *array_src, const float f, const int size)
 
void madd_vn_vnvn (float *array_tar, const float *array_src_a, const float *array_src_b, const float f, const int size)
 
void sub_vn_vn (float *array_tar, const float *array_src, const int size)
 
void sub_vn_vnvn (float *array_tar, const float *array_src_a, const float *array_src_b, const int size)
 
void msub_vn_vn (float *array_tar, const float *array_src, const float f, const int size)
 
void msub_vn_vnvn (float *array_tar, const float *array_src_a, const float *array_src_b, const float f, const int size)
 
void interp_vn_vn (float *array_tar, const float *array_src, const float t, const int size)
 
void copy_vn_i (int *array_tar, const int size, const int val)
 
void copy_vn_short (short *array_tar, const int size, const short val)
 
void copy_vn_ushort (ushort *array_tar, const int size, const ushort val)
 
void copy_vn_uchar (uchar *array_tar, const int size, const uchar val)
 
void copy_vn_fl (float *array_tar, const int size, const float val)
 
Cubic curve interpolation (bezier spline).
void interp_v2_v2v2v2v2_cubic (float p[2], const float v1[2], const float v2[2], const float v3[2], const float v4[2], const float u)
 
Double precision versions 'db'.
void add_vn_vn_d (double *array_tar, const double *array_src, const int size)
 
void add_vn_vnvn_d (double *array_tar, const double *array_src_a, const double *array_src_b, const int size)
 
void mul_vn_db (double *array_tar, const int size, const double f)
 
void interp_v3_v3v3_db (double target[3], const double a[3], const double b[3], const double t)
 
void interp_v2_v2v2_db (double target[2], const double a[2], const double b[2], const double t)
 

Macro Definition Documentation

◆ SWAP_AXIS

#define SWAP_AXIS (   a,
 
)
Value:
{ \
SWAP(float, v[a], v[b]); \
SWAP(int, r_axis_order[a], r_axis_order[b]); \
} \
(void)0
ATTR_WARN_UNUSED_RESULT const BMVert * v
static unsigned a[3]
Definition: RandGen.cpp:92

Function Documentation

◆ add_vn_vn()

void add_vn_vn ( float array_tar,
const float array_src,
const int  size 
)

Definition at line 1263 of file math_vector.c.

References size().

Referenced by Color_iadd(), and Vector_iadd().

◆ add_vn_vn_d()

void add_vn_vn_d ( double array_tar,
const double array_src,
const int  size 
)

Definition at line 1423 of file math_vector.c.

References size().

Referenced by BLI_quadric_add_qu_qu().

◆ add_vn_vnvn()

void add_vn_vnvn ( float array_tar,
const float array_src_a,
const float array_src_b,
const int  size 
)

Definition at line 1273 of file math_vector.c.

References size().

Referenced by Color_add(), Matrix_add(), and Vector_add().

◆ add_vn_vnvn_d()

void add_vn_vnvn_d ( double array_tar,
const double array_src_a,
const double array_src_b,
const int  size 
)

Definition at line 1433 of file math_vector.c.

References size().

Referenced by BLI_quadric_add_qu_ququ().

◆ angle_normalized_v2v2()

float angle_normalized_v2v2 ( const float  a[2],
const float  b[2] 
)

◆ angle_normalized_v3v3()

float angle_normalized_v3v3 ( const float  v1[3],
const float  v2[3] 
)

◆ angle_on_axis_v3v3_v3()

float angle_on_axis_v3v3_v3 ( const float  v1[3],
const float  v2[3],
const float  axis[3] 
)

Angle between 2 vectors, about an axis (axis can be considered a plane).

Definition at line 540 of file math_vector.c.

References angle_v3v3(), project_plane_normalized_v3_v3v3(), v1, and v2.

Referenced by angle_on_axis_v3v3v3_v3().

◆ angle_on_axis_v3v3v3_v3()

float angle_on_axis_v3v3v3_v3 ( const float  v1[3],
const float  v2[3],
const float  v3[3],
const float  axis[3] 
)

Angle between 2 vectors defined by 3 coords, about an axis (axis can be considered a plane).

Definition at line 574 of file math_vector.c.

References angle_on_axis_v3v3_v3(), sub_v3_v3v3(), v1, and v2.

Referenced by BM_mesh_wireframe().

◆ angle_poly_v3()

void angle_poly_v3 ( float angles,
const float verts[3],
int  len 
)

Definition at line 639 of file math_vector.c.

References angle_normalized_v3v3(), float(), len, M_PI, normalize_v3(), sub_v3_v3v3(), and verts.

Referenced by solidify_add_thickness().

◆ angle_quad_v3()

void angle_quad_v3 ( float  angles[4],
const float  v1[3],
const float  v2[3],
const float  v3[3],
const float  v4[3] 
)

Definition at line 618 of file math_vector.c.

References angle_normalized_v3v3(), float(), M_PI, normalize_v3(), sub_v3_v3v3(), v1, and v2.

◆ angle_signed_on_axis_v3v3_v3()

float angle_signed_on_axis_v3v3_v3 ( const float  v1[3],
const float  v2[3],
const float  axis[3] 
)

◆ angle_signed_on_axis_v3v3v3_v3()

float angle_signed_on_axis_v3v3v3_v3 ( const float  v1[3],
const float  v2[3],
const float  v3[3],
const float  axis[3] 
)

◆ angle_signed_v2v2()

float angle_signed_v2v2 ( const float  v1[2],
const float  v2[2] 
)

◆ angle_tri_v3()

void angle_tri_v3 ( float  angles[3],
const float  v1[3],
const float  v2[3],
const float  v3[3] 
)

Definition at line 600 of file math_vector.c.

References angle_normalized_v3v3(), float(), M_PI, normalize_v3(), sub_v3_v3v3(), v1, and v2.

◆ angle_v2v2()

float angle_v2v2 ( const float  a[2],
const float  b[2] 
)

◆ angle_v2v2v2()

float angle_v2v2v2 ( const float  a[2],
const float  b[2],
const float  c[2] 
)

◆ angle_v3v3()

float angle_v3v3 ( const float  a[3],
const float  b[3] 
)

◆ angle_v3v3v3()

float angle_v3v3v3 ( const float  a[3],
const float  b[3],
const float  c[3] 
)

◆ axis_sort_v3()

void axis_sort_v3 ( const float  axis_values[3],
int  r_axis_order[3] 
)

Definition at line 1090 of file math_vector.c.

References copy_v3_v3(), SWAP_AXIS, and v.

Referenced by bm_vert_tri_find_unique_edge(), draw_view_axis(), and splineik_evaluate_bone().

◆ bisect_v3_v3v3v3()

void bisect_v3_v3v3v3 ( float  r[3],
const float  a[3],
const float  b[3],
const float  c[3] 
)

◆ copy_vn_fl()

void copy_vn_fl ( float array_tar,
const int  size,
const float  val 
)

◆ copy_vn_i()

void copy_vn_i ( int *  array_tar,
const int  size,
const int  val 
)

◆ copy_vn_short()

void copy_vn_short ( short *  array_tar,
const int  size,
const short  val 
)

Definition at line 1383 of file math_vector.c.

References size().

Referenced by initNumInput().

◆ copy_vn_uchar()

void copy_vn_uchar ( uchar array_tar,
const int  size,
const uchar  val 
)

Definition at line 1401 of file math_vector.c.

References size().

Referenced by bicubic_interpolation(), and bilinear_interpolation().

◆ copy_vn_ushort()

void copy_vn_ushort ( ushort array_tar,
const int  size,
const ushort  val 
)

Definition at line 1392 of file math_vector.c.

References size().

Referenced by imb_read_tiff_pixels().

◆ cos_v2v2v2()

float cos_v2v2v2 ( const float  p1[2],
const float  p2[2],
const float  p3[2] 
)

Definition at line 470 of file math_vector.c.

References dot_v2v2(), normalize_v2(), and sub_v2_v2v2().

Referenced by scanfill().

◆ cos_v3v3v3()

float cos_v3v3v3 ( const float  p1[3],
const float  p2[3],
const float  p3[3] 
)

Definition at line 430 of file math_vector.c.

References dot_v3v3(), normalize_v3(), and sub_v3_v3v3().

Referenced by bm_vert_collapse_is_degenerate().

◆ dist_ensure_v2_v2fl()

void dist_ensure_v2_v2fl ( float  v1[2],
const float  v2[2],
const float  dist 
)

◆ dist_ensure_v3_v3fl()

void dist_ensure_v3_v3fl ( float  v1[3],
const float  v2[3],
const float  dist 
)

ensure v1 is dist from v2

Definition at line 1068 of file math_vector.c.

References equals_v3v3(), madd_v3_v3v3fl(), nor, normalize_v3(), sub_v3_v3v3(), v1, and v2.

Referenced by Bend(), BKE_nurbList_handles_recalculate(), and brush_puff().

◆ dot_vn_vn()

double dot_vn_vn ( const float array_src_a,
const float array_src_b,
const int  size 
)

◆ flip_v2_v2v2()

void flip_v2_v2v2 ( float  v[2],
const float  v1[2],
const float  v2[2] 
)

Definition at line 385 of file math_vector.c.

References v, v1, and v2.

◆ flip_v3_v3v3()

void flip_v3_v3v3 ( float  v[3],
const float  v1[3],
const float  v2[3] 
)

Definition at line 378 of file math_vector.c.

References v, v1, and v2.

◆ flip_v4_v4v4()

void flip_v4_v4v4 ( float  v[4],
const float  v1[4],
const float  v2[4] 
)

Equivalent to: interp_v3_v3v3(v, v1, v2, -1.0f);

Definition at line 370 of file math_vector.c.

References v, v1, and v2.

◆ interp_v2_v2v2()

void interp_v2_v2v2 ( float  r[2],
const float  a[2],
const float  b[2],
const float  t 
)

◆ interp_v2_v2v2_db()

void interp_v2_v2v2_db ( double  target[2],
const double  a[2],
const double  b[2],
const double  t 
)

Definition at line 1465 of file math_vector.c.

References Freestyle::a, and t.

Referenced by lineart_edge_first_bounding_area().

◆ interp_v2_v2v2_slerp()

bool interp_v2_v2v2_slerp ( float  target[2],
const float  a[2],
const float  b[2],
const float  t 
)

Definition at line 96 of file math_vector.c.

References Freestyle::a, BLI_ASSERT_UNIT_V2, dot_v2v2(), interp_dot_slerp(), t, UNLIKELY, and w().

Referenced by interp_v2_v2v2_slerp_safe().

◆ interp_v2_v2v2_slerp_safe()

void interp_v2_v2v2_slerp_safe ( float  target[2],
const float  a[2],
const float  b[2],
const float  t 
)

◆ interp_v2_v2v2v2()

void interp_v2_v2v2v2 ( float  r[2],
const float  a[2],
const float  b[2],
const float  c[2],
const float  t[3] 
)

◆ interp_v2_v2v2v2v2_cubic()

void interp_v2_v2v2v2v2_cubic ( float  p[2],
const float  v1[2],
const float  v2[2],
const float  v3[2],
const float  v4[2],
const float  u 
)

Definition at line 168 of file math_vector.c.

References interp_v2_v2v2(), q1, v1, and v2.

Referenced by add_bezier(), BKE_mask_point_segment_co(), and gpencil_primitive_bezier().

◆ interp_v3_v3v3()

void interp_v3_v3v3 ( float  r[3],
const float  a[3],
const float  b[3],
const float  t 
)

Definition at line 49 of file math_vector.c.

References Freestyle::a, r, and t.

Referenced by alter_co(), Bend(), BKE_gpencil_stroke_close(), BKE_gpencil_stroke_shrink(), BKE_gpencil_stroke_smooth(), BKE_gpencil_stroke_stretch(), BKE_gpencil_stroke_subdivide(), BKE_gpencil_stroke_uniform_subdivide(), BKE_lattice_deform_data_eval_co(), BKE_mesh_remap_calc_edges_from_mesh(), blend_m3_m3m3(), blend_m4_m4m4(), bm_bridge_splice_loops(), bm_decim_edge_collapse(), bm_edgering_pair_interpolate(), bm_face_split_edge_find(), bm_grid_fill_array(), bm_isect_tri_tri(), bm_subdivide_edge_addvert(), bmo_planar_faces_exec(), bmo_smooth_vert_exec(), boid_find_ground(), bone_locked_color_shade(), brush_average_apply(), brush_blur_apply(), brush_smear_apply(), brush_tint_apply(), calculate_profile_segments(), cloth_calc_average_acceleration(), cloth_calc_force(), cloth_collision_response_static(), cloth_continuum_step(), collision_move_object(), collision_newton_rhapson(), collision_response(), compute_collision_point_edge_tri(), constraint_target_to_mat4(), converge(), createEdgeSlideVerts_single_side(), deformStroke(), dist_squared_ray_to_seg_v3(), distlimit_evaluate(), do_clay_thumb_brush_task_cb_ex(), do_clump_level(), do_displacement_smear_brush_task_cb_ex(), do_guides(), do_kink(), do_kink_spiral(), doVertSlide(), draw_frustum_bound_sphere_calc(), DRW_text_edit_mesh_measure_stats(), duplicateStroke(), ED_gpencil_select_stroke_segment(), edbm_blend_from_shape_exec(), evaluate_cubic_bezier(), blender::compositor::ColorCurveOperation::executePixelSampled(), blender::compositor::ConstantLevelColorCurveOperation::executePixelSampled(), find_nearest_edge__doClosest(), flyApply(), generate_semi_circle_from_point_to_point(), get_bone_solid_with_consts_color(), gizmo_ruler_invoke(), gpencil_add_new_points(), GPENCIL_draw_scene(), gpencil_draw_strokes(), gpencil_hook_co_apply(), gpencil_interpolate_update_points(), gpencil_stroke_perimeter_ex(), gpencil_stroke_subdivide(), gpencil_stroke_to_bezier(), gpencil_stroke_to_path(), gpencil_subdivide_stroke(), graph_refresh_fcurve_colors(), hook_co_apply(), interp_line_v3_v3v3v3(), interp_m3_m3m3(), interp_m4_m4m4(), interp_slerp_co_no_v3(), interpolate_pathcache(), isect_tri_tri_v3_ex(), knife_find_closest_edge_of_face(), knife_interp_v3_v3v3(), limit_dist_v3(), loop_interp_multires_cb(), mesh_symmetry_snap_exec(), minter_v3_v3v3v3_ref(), mixColors(), node_shader_exec_curve_rgb(), node_shader_exec_invert(), offset_on_edge_between(), pipe_adj_vmesh(), position_tail_on_spline(), blender::io::gpencil::GpencilIO::prepare_stroke_export_colors(), project_paint_face_init(), psys_cache_edit_paths_iter(), blender::io::alembic::read_mverts_interp(), rotateBevelPiece(), sculpt_rake_data_update(), shrinkwrap_calc_nearest_surface_point_cb_ex(), shrinkwrap_calc_nearest_vertex_cb_ex(), shrinkwrap_calc_normal_projection_cb_ex(), shrinkwrap_get_tarmat(), shrinkwrap_snap_with_side(), SIM_cloth_solve(), SIM_hair_volume_add_segment(), SIM_hair_volume_grid_velocity(), SIM_hair_volume_solve_divergence(), SimpleDeformModifier_do(), skin_smooth_hulls(), snap_mesh_edge_verts_mixed(), splineik_evaluate_bone(), square_out_adj_vmesh(), state_calc_co_pair(), stroke_elem_interp(), stroke_march_next_point(), stroke_march_next_point_no_interp(), subdiv_mesh_vertex_of_loose_edge(), subdivide_base(), subdividenurb(), target_project_edge(), test_projected_edge_dist(), track_channel_color(), transform_point_by_seg_v3(), tri_v3_scale(), ui_draw_but_CURVE(), ui_draw_but_CURVEPROFILE(), view3d_preselect_mesh_edgering_update_edges_from_edge(), view3d_preselect_mesh_edgering_update_verts_from_edge(), view3d_smoothview_apply(), viewrotate_apply(), warpModifier_do(), and WIDGETGROUP_xform_shear_setup().

◆ interp_v3_v3v3_char()

void interp_v3_v3v3_char ( char  target[3],
const char  a[3],
const char  b[3],
const float  t 
)

Definition at line 251 of file math_vector.c.

References Freestyle::a, interp_v3_v3v3_uchar(), and t.

◆ interp_v3_v3v3_db()

void interp_v3_v3v3_db ( double  target[3],
const double  a[3],
const double  b[3],
const double  t 
)

◆ interp_v3_v3v3_slerp()

bool interp_v3_v3v3_slerp ( float  target[3],
const float  a[3],
const float  b[3],
const float  t 
)

slerp, treat vectors as spherical coordinates

See also
interp_qt_qtqt
Returns
success

Definition at line 74 of file math_vector.c.

References Freestyle::a, BLI_ASSERT_UNIT_V3, dot_v3v3(), interp_dot_slerp(), t, UNLIKELY, and w().

Referenced by interp_slerp_co_no_v3(), and interp_v3_v3v3_slerp_safe().

◆ interp_v3_v3v3_slerp_safe()

void interp_v3_v3v3_slerp_safe ( float  target[3],
const float  a[3],
const float  b[3],
const float  t 
)

◆ interp_v3_v3v3_uchar()

void interp_v3_v3v3_uchar ( uchar  target[3],
const uchar  a[3],
const uchar  b[3],
const float  t 
)

Definition at line 243 of file math_vector.c.

References Freestyle::a, floorf, and t.

Referenced by interp_v3_v3v3_char(), and widget_tab().

◆ interp_v3_v3v3v3()

void interp_v3_v3v3v3 ( float  p[3],
const float  v1[3],
const float  v2[3],
const float  v3[3],
const float  w[3] 
)

◆ interp_v3_v3v3v3_uv()

void interp_v3_v3v3v3_uv ( float  p[3],
const float  v1[3],
const float  v2[3],
const float  v3[3],
const float  uv[2] 
)

Definition at line 235 of file math_vector.c.

References v1, and v2.

Referenced by bmbvh_ray_cast_handle_hit(), knife_ray_intersect_face(), and statvis_calc_thickness().

◆ interp_v3_v3v3v3v3()

void interp_v3_v3v3v3v3 ( float  p[3],
const float  v1[3],
const float  v2[3],
const float  v3[3],
const float  v4[3],
const float  w[4] 
)

◆ interp_v4_v4v4()

void interp_v4_v4v4 ( float  r[4],
const float  a[4],
const float  b[4],
const float  t 
)

◆ interp_v4_v4v4_char()

void interp_v4_v4v4_char ( char  target[4],
const char  a[4],
const char  b[4],
const float  t 
)

Definition at line 265 of file math_vector.c.

References Freestyle::a, interp_v4_v4v4_uchar(), and t.

◆ interp_v4_v4v4_uchar()

void interp_v4_v4v4_uchar ( uchar  target[4],
const uchar  a[4],
const uchar  b[4],
const float  t 
)

Definition at line 256 of file math_vector.c.

References Freestyle::a, floorf, and t.

Referenced by interp_v4_v4v4_char().

◆ interp_v4_v4v4v4()

void interp_v4_v4v4v4 ( float  p[4],
const float  v1[4],
const float  v2[4],
const float  v3[4],
const float  w[3] 
)

Definition at line 213 of file math_vector.c.

References v1, v2, and w().

Referenced by dynamic_paint_set_init_color_vcol_to_imseq_cb(), and blender::attribute_math::mix3().

◆ interp_v4_v4v4v4v4()

void interp_v4_v4v4v4v4 ( float  p[4],
const float  v1[4],
const float  v2[4],
const float  v3[4],
const float  v4[4],
const float  w[4] 
)

Definition at line 222 of file math_vector.c.

References v1, v2, and w().

◆ interp_vn_vn()

void interp_vn_vn ( float array_tar,
const float array_src,
const float  t,
const int  size 
)

Definition at line 1361 of file math_vector.c.

References size(), and t.

Referenced by meshcache_do(), and Vector_lerp().

◆ is_finite_v2()

bool is_finite_v2 ( const float  v[2])

Definition at line 393 of file math_vector.c.

References CCL_NAMESPACE_BEGIN::isfinite(), and v.

Referenced by accumulate_marker(), and layerValidate_mloopuv().

◆ is_finite_v3()

bool is_finite_v3 ( const float  v[3])

◆ is_finite_v4()

bool is_finite_v4 ( const float  v[4])

Definition at line 403 of file math_vector.c.

References CCL_NAMESPACE_BEGIN::isfinite(), and v.

Referenced by barycentric_weights_v2_quad(), and SCULPT_do_paint_brush().

◆ len_squared_vn()

double len_squared_vn ( const float array,
const int  size 
)

Definition at line 1141 of file math_vector.c.

References size(), and sqr_db().

Referenced by normalize_vn_vn(), and Vector_richcmpr().

◆ madd_vn_vn()

void madd_vn_vn ( float array_tar,
const float array_src,
const float  f,
const int  size 
)

Definition at line 1287 of file math_vector.c.

References size().

◆ madd_vn_vnvn()

void madd_vn_vnvn ( float array_tar,
const float array_src_a,
const float array_src_b,
const float  f,
const int  size 
)

Definition at line 1297 of file math_vector.c.

References size().

◆ mid_v2_v2v2()

void mid_v2_v2v2 ( float  r[2],
const float  a[2],
const float  b[2] 
)

◆ mid_v2_v2v2v2()

void mid_v2_v2v2v2 ( float  v[2],
const float  v1[2],
const float  v2[2],
const float  v3[2] 
)

Definition at line 283 of file math_vector.c.

References v, v1, and v2.

Referenced by overlap_tri_tri_uv_test().

◆ mid_v3_angle_weighted()

void mid_v3_angle_weighted ( float  r[3])

Same as mid_v3_v3v3_angle_weighted but r is assumed to be accumulated normals, divided by their total.

Definition at line 348 of file math_vector.c.

References acosf, angle(), BLI_assert, float(), len_squared_v3(), M_PI, mul_v3_fl(), normalize_v3(), and r.

◆ mid_v3_v3_array()

void mid_v3_v3_array ( float  r[3],
const float(*)  vec_arr[3],
const uint  nbr 
)

Definition at line 304 of file math_vector.c.

References float(), madd_v3_v3fl(), r, and zero_v3().

Referenced by computeBindWeights(), and deformVert().

◆ mid_v3_v3v3()

void mid_v3_v3v3 ( float  r[3],
const float  a[3],
const float  b[3] 
)

Definition at line 270 of file math_vector.c.

References Freestyle::a, and r.

Referenced by _scan_for_ext_spring_forces(), _softbody_calc_forces_slice_in_a_thread(), alter_co(), BKE_curve_center_bounds(), BKE_curve_texspace_calc(), BKE_lattice_center_bounds(), BKE_mball_center_bounds(), BKE_mesh_center_bounds(), BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(), BKE_mesh_remesh_voxel_fix_poles(), BKE_mesh_texspace_calc(), BKE_pbvh_raycast_project_ray_root(), bm_decim_build_quadrics(), bm_edge_symmetry_map(), BM_editselection_center(), BM_face_calc_center_bounds(), BM_face_calc_center_bounds_vcos(), BM_face_multires_bounds_smooth(), BM_vert_tri_calc_tangent_edge_pair(), bm_vert_tri_find_unique_edge(), BMBVH_EdgeVisible(), bmo_inset_region_exec(), brush_edit_init(), build_vmesh(), bundle_midpoint(), calc_ortho_extent(), calculateCenterBound(), collapse_face_corners(), compute_mdisp_quad(), createTransEdge(), cutEdges(), draw_bone_name(), draw_frustum_bound_sphere_calc(), draw_primitive_view_impl(), drw_call_culling_init(), DRW_text_edit_mesh_measure_stats(), ED_armature_origin_set(), edbm_face_split_by_edges_exec(), edbm_point_normals_modal(), edbm_polybuild_face_at_cursor_invoke(), edbm_polybuild_split_at_cursor_invoke(), edbm_rip_edge_side_measure(), edbm_rip_invoke__vert(), EDBM_unified_findnearest_from_raycast(), edgetag_cut_cost_face(), facetag_cut_cost_edge(), find_first_points(), gizmo_prepare_mat(), gpencil_snap_cursor_to_sel(), interp_slerp_co_no_v3(), knife_find_closest_edge_of_face(), knife_find_line_hits(), knife_verts_edge_in_face(), match_texture_space_exec(), merge_frame_corners(), mesh_filter_task_cb(), multires_subdivide_create_object_space_linear_grids(), object_origin_set_exec(), offset_meet(), offset_on_edge_between(), pbvh_bmesh_collapse_edge(), pbvh_bmesh_split_edge(), peelObjectsTransform(), quad_verts_to_barycentric_tri(), SCULPT_do_multiplane_scrape_brush(), set_profile_params(), smoothModifier_do(), snap_curs_to_sel_ex(), snap_mesh_edge_verts_mixed(), sort_bmelem_flag(), square_out_adj_vmesh(), uv_map_transform_center(), view3d_from_minmax(), view3d_interactive_add_modal(), view3d_localview_init(), view3d_preselect_update_preview_triangle_from_edge(), voxel_size_edit_invoke(), voxel_size_parallel_lines_draw(), and WIDGETGROUP_xform_cage_refresh().

◆ mid_v3_v3v3_angle_weighted()

void mid_v3_v3v3_angle_weighted ( float  r[3],
const float  a[3],
const float  b[3] 
)

Specialized function for calculating normals. Fast-path for:

#define M_PI_2
Definition: BLI_math_base.h:41
MINLINE float normalize_v3(float r[3])
MINLINE void mul_v3_fl(float r[3], float f)
MINLINE void add_v3_v3v3(float r[3], const float a[3], const float b[3])
float angle_normalized_v3v3(const float v1[3], const float v2[3]) ATTR_WARN_UNUSED_RESULT
Definition: math_vector.c:505
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble GLdouble r _GL_VOID_RET _GL_VOID GLfloat GLfloat r _GL_VOID_RET _GL_VOID GLint GLint r _GL_VOID_RET _GL_VOID GLshort GLshort r _GL_VOID_RET _GL_VOID GLdouble GLdouble r

We can use the length of (a + b) to calculate the angle.

Definition at line 326 of file math_vector.c.

References Freestyle::a, acosf, add_v3_v3v3(), angle(), BLI_ASSERT_UNIT_V3, float(), M_PI, mul_v3_fl(), normalize_v3(), and r.

Referenced by mesh_calc_hq_normal().

◆ mid_v3_v3v3v3()

void mid_v3_v3v3v3 ( float  v[3],
const float  v1[3],
const float  v2[3],
const float  v3[3] 
)

◆ mid_v3_v3v3v3v3()

void mid_v3_v3v3v3v3 ( float  v[3],
const float  v1[3],
const float  v2[3],
const float  v3[3],
const float  v4[3] 
)

Definition at line 296 of file math_vector.c.

References v, v1, and v2.

Referenced by BKE_mesh_calc_poly_center(), connect_frames(), draw_primitive_view_impl(), and mdisp_in_mdispquad().

◆ minmax_v2v2_v2()

void minmax_v2v2_v2 ( float  min[2],
float  max[2],
const float  vec[2] 
)

◆ minmax_v3v3_v3()

void minmax_v3v3_v3 ( float  min[3],
float  max[3],
const float  vec[3] 
)

◆ minmax_v3v3_v3_array()

void minmax_v3v3_v3_array ( float  r_min[3],
float  r_max[3],
const float(*)  vec_arr[3],
int  nbr 
)

Definition at line 1060 of file math_vector.c.

References minmax_v3v3_v3().

Referenced by calc_ortho_extent().

◆ minmax_v4v4_v4()

void minmax_v4v4_v4 ( float  min[4],
float  max[4],
const float  vec[4] 
)

Definition at line 991 of file math_vector.c.

References max, and min.

Referenced by layerDoMinMax_propcol().

◆ msub_vn_vn()

void msub_vn_vn ( float array_tar,
const float array_src,
const float  f,
const int  size 
)

Definition at line 1336 of file math_vector.c.

References size().

◆ msub_vn_vnvn()

void msub_vn_vnvn ( float array_tar,
const float array_src_a,
const float array_src_b,
const float  f,
const int  size 
)

Definition at line 1346 of file math_vector.c.

References size().

◆ mul_vn_db()

void mul_vn_db ( double array_tar,
const int  size,
const double  f 
)

Definition at line 1447 of file math_vector.c.

References size().

Referenced by BLI_quadric_mul().

◆ mul_vn_fl()

void mul_vn_fl ( float array_tar,
const int  size,
const float  f 
)

◆ mul_vn_vn()

void mul_vn_vn ( float array_tar,
const float array_src,
const int  size 
)

Definition at line 1220 of file math_vector.c.

References size().

Referenced by Matrix_imul(), Quaternion_imul(), and Vector_imul().

◆ mul_vn_vn_fl()

void mul_vn_vn_fl ( float array_tar,
const float array_src,
const int  size,
const float  f 
)

Definition at line 1253 of file math_vector.c.

References size().

Referenced by color_mul_float(), matrix_mul_float(), normalize_vn_vn(), Vector_div(), and vector_mul_float().

◆ mul_vn_vnvn()

void mul_vn_vnvn ( float array_tar,
const float array_src_a,
const float array_src_b,
const int  size 
)

Definition at line 1230 of file math_vector.c.

References size().

Referenced by Matrix_mul(), Quaternion_mul(), and vector_mul_vec().

◆ negate_vn()

void negate_vn ( float array_tar,
const int  size 
)

Definition at line 1201 of file math_vector.c.

References size().

◆ negate_vn_vn()

void negate_vn_vn ( float array_tar,
const float array_src,
const int  size 
)

Definition at line 1210 of file math_vector.c.

References size().

Referenced by Color_neg(), and Vector_neg().

◆ normalize_vn()

float normalize_vn ( float array_tar,
const int  size 
)

Definition at line 1167 of file math_vector.c.

References normalize_vn_vn(), and size().

Referenced by M_Noise_random_unit_vector(), Vector_normalize(), and Vector_slerp().

◆ normalize_vn_vn()

float normalize_vn_vn ( float array_tar,
const float array_src,
const int  size 
)

Definition at line 1152 of file math_vector.c.

References copy_vn_fl(), float(), len_squared_vn(), mul_vn_vn_fl(), size(), and sqrt().

Referenced by normalize_vn(), and Vector_slerp().

◆ ortho_basis_v3v3_v3()

void ortho_basis_v3v3_v3 ( float  r_n1[3],
float  r_n2[3],
const float  n[3] 
)

Takes a vector and computes 2 orthogonal directions.

Note
if n is n unit length, computed values will be too.

Definition at line 845 of file math_vector.c.

References BLI_assert, eps, CCL_NAMESPACE_BEGIN::isfinite(), len_squared_v2(), and sqrtf.

Referenced by alter_co(), axis_dominant_v3_to_m3(), axis_dominant_v3_to_m3_negate(), drawDial3d(), mesh_calc_eigen_matrix(), sculpt_pose_align_pivot_local_space(), and wm_gizmo_set_matrix_rotation_from_z_axis__internal().

◆ ortho_v2_v2()

void ortho_v2_v2 ( float  out[2],
const float  v[2] 
)

no brainer compared to v3, just have for consistency.

Definition at line 903 of file math_vector.c.

References BLI_assert, and v.

Referenced by interp_v2_v2v2_slerp_safe(), Vector_orthogonal(), and wm_gesture_draw_line_active_side().

◆ ortho_v3_v3()

void ortho_v3_v3 ( float  out[3],
const float  v[3] 
)

◆ print_v2()

void print_v2 ( const char *  str,
const float  v[2] 
)

Definition at line 966 of file math_vector.c.

References str, and v.

◆ print_v3()

void print_v3 ( const char *  str,
const float  v[3] 
)

Definition at line 971 of file math_vector.c.

References str, and v.

Referenced by raycast_callback().

◆ print_v4()

void print_v4 ( const char *  str,
const float  v[4] 
)

Definition at line 976 of file math_vector.c.

References str, and v.

◆ print_vn()

void print_vn ( const char *  str,
const float  v[],
const int  n 
)

Definition at line 981 of file math_vector.c.

References str, and v.

◆ project_plane_normalized_v2_v2v2()

void project_plane_normalized_v2_v2v2 ( float  out[2],
const float  p[2],
const float  v_plane[2] 
)

Definition at line 767 of file math_vector.c.

References BLI_ASSERT_UNIT_V2, dot_v2v2(), and mul().

◆ project_plane_normalized_v3_v3v3()

void project_plane_normalized_v3_v3v3 ( float  out[3],
const float  p[3],
const float  v_plane[3] 
)

◆ project_plane_v2_v2v2()

void project_plane_v2_v2v2 ( float  out[2],
const float  p[2],
const float  v_plane[2] 
)

Definition at line 749 of file math_vector.c.

References dot_v2v2(), and mul().

◆ project_plane_v3_v3v3()

void project_plane_v3_v3v3 ( float  out[3],
const float  p[3],
const float  v_plane[3] 
)

In this case plane is a 3D vector only (no 4th component).

Projecting will make out a copy of p orthogonal to v_plane.

Note
If p is exactly perpendicular to v_plane, out will just be a copy of p.
This function is a convenience to call:
project_v3_v3v3(out, p, v_plane);
sub_v3_v3v3(out, p, out);
MINLINE void sub_v3_v3v3(float r[3], const float a[3], const float b[3])
void project_v3_v3v3(float out[3], const float p[3], const float v_proj[3])
Definition: math_vector.c:674

Definition at line 740 of file math_vector.c.

References dot_v3v3(), and mul().

Referenced by BKE_object_empty_image_data_is_visible_in_view3d(), calc_sculpt_plane(), calcVertSlideMouseActiveEdges(), do_crease_brush_task_cb_ex(), do_pinch_brush_task_cb_ex(), do_snake_hook_brush_task_cb_ex(), do_vpaint_brush_smear_task_cb_ex(), do_wpaint_brush_smear_task_cb_ex(), ED_view3d_cursor3d_position_rotation(), gizmo_arrow_modal(), is_quad_convex_v3(), screen_px_line_point_factor_v2_persp(), SCULPT_calc_brush_plane(), sculpt_project_v3(), sculpt_project_v3_normal_align(), sculpt_update_brush_delta(), transform_orientations_create_from_axis(), and update_sculpt_normal().

◆ project_v2_v2v2()

void project_v2_v2v2 ( float  out[2],
const float  p[2],
const float  v_proj[2] 
)

Project p onto v_proj

Definition at line 658 of file math_vector.c.

References dot_v2v2(), is_zero_v2(), mul(), UNLIKELY, and zero_v2().

Referenced by BKE_mask_point_set_handle().

◆ project_v2_v2v2_normalized()

void project_v2_v2v2_normalized ( float  out[2],
const float  p[2],
const float  v_proj[2] 
)

Project p onto a unit length v_proj

Definition at line 705 of file math_vector.c.

References BLI_ASSERT_UNIT_V2, dot_v2v2(), and mul().

Referenced by slide_point_modal().

◆ project_v3_plane()

void project_v3_plane ( float  out[3],
const float  plane_no[3],
const float  plane_co[3] 
)

Definition at line 777 of file math_vector.c.

References dot_v3v3(), len_squared_v3(), mul(), mul_v3_v3fl(), sub_v3_v3(), and sub_v3_v3v3().

Referenced by interp_slerp_co_no_v3().

◆ project_v3_v3v3()

void project_v3_v3v3 ( float  out[3],
const float  p[3],
const float  v_proj[3] 
)

◆ project_v3_v3v3_db()

void project_v3_v3v3_db ( double  out[3],
const double  p[3],
const double  v_proj[3] 
)

Definition at line 688 of file math_vector.c.

References dot_v3v3_db(), is_zero_v3_db(), mul(), UNLIKELY, and zero_v3_db().

Referenced by blender::double3::project().

◆ project_v3_v3v3_normalized()

void project_v3_v3v3_normalized ( float  out[3],
const float  p[3],
const float  v_proj[3] 
)

Project p onto a unit length v_proj

Definition at line 717 of file math_vector.c.

References BLI_ASSERT_UNIT_V3, dot_v3v3(), and mul().

Referenced by dist_squared_to_ray_v3_normalized(), ED_armature_ebone_roll_to_vector(), and mesh_remove_doubles_on_axis().

◆ range_vn_fl()

void range_vn_fl ( float array_tar,
const int  size,
const float  start,
const float  step 
)

Definition at line 1192 of file math_vector.c.

References size().

Referenced by C_Vector_Linspace(), and C_Vector_Range().

◆ range_vn_i()

void range_vn_i ( int *  array_tar,
const int  size,
const int  start 
)

◆ range_vn_u()

void range_vn_u ( uint array_tar,
const int  size,
const uint  start 
)

Definition at line 1182 of file math_vector.c.

References size().

Referenced by material_slot_move_exec(), and weldModifier_doWeld().

◆ reflect_v3_v3v3()

void reflect_v3_v3v3 ( float  out[3],
const float  v[3],
const float  normal[3] 
)

Returns a reflection vector from a vector and a normal vector reflect = vec - ((2 * dot(vec, mirror)) * mirror).

v
+  ^
 \ |
  |
   + normal: axis of reflection
  /
 /
+
out: result (negate for a 'bounce').

Definition at line 818 of file math_vector.c.

References BLI_ASSERT_UNIT_V3, dot_v3v3(), normal, and v.

Referenced by alter_co(), ElementMirror(), blender::float3::reflected(), studiolight_lights_eval(), studiolight_radiance_preview(), and Vector_reflect().

◆ reflect_v3_v3v3_db()

void reflect_v3_v3v3_db ( double  out[3],
const double  v[3],
const double  normal[3] 
)

Definition at line 829 of file math_vector.c.

References dot_v3v3_db(), normal, and v.

Referenced by blender::double3::reflected().

◆ rotate_normalized_v3_v3v3fl()

void rotate_normalized_v3_v3v3fl ( float  out[3],
const float  p[3],
const float  axis[3],
const float  angle 
)

Rotate a point p by angle around an arbitrary unit length axis. http://local.wasp.uwa.edu.au/~pbourke/geometry/

Definition at line 929 of file math_vector.c.

References angle(), BLI_ASSERT_UNIT_V3, cosf, and sinf.

Referenced by build_emats_stack(), connection_node_mat(), map_to_plane_axis_angle_v2_v3v3fl(), and rotate_v3_v3v3fl().

◆ rotate_v2_v2fl()

void rotate_v2_v2fl ( float  r[2],
const float  p[2],
const float  angle 
)

◆ rotate_v3_v3v3fl()

void rotate_v3_v3v3fl ( float  r[3],
const float  p[3],
const float  axis[3],
const float  angle 
)

◆ sqr_db()

MINLINE double sqr_db ( double  f)

Definition at line 1124 of file math_vector.c.

Referenced by len_squared_vn().

◆ sub_vn_vn()

void sub_vn_vn ( float array_tar,
const float array_src,
const int  size 
)

Definition at line 1312 of file math_vector.c.

References size().

Referenced by Color_isub(), and Vector_isub().

◆ sub_vn_vnvn()

void sub_vn_vnvn ( float array_tar,
const float array_src_a,
const float array_src_b,
const int  size 
)

Definition at line 1322 of file math_vector.c.

References size().

Referenced by Color_sub(), Matrix_sub(), v3d_editvertex_buts(), and Vector_sub().