Blender  V2.59
Defines | Functions
BLI_math_base.h File Reference
#include <math.h>
#include "BLI_math_inline.h"
#include "intern/math_base_inline.c"

Go to the source code of this file.

Defines

#define M_PI   3.14159265358979323846
#define M_PI_2   1.57079632679489661923
#define M_SQRT2   1.41421356237309504880
#define M_SQRT1_2   0.70710678118654752440
#define M_1_PI   0.318309886183790671538
#define M_E   2.7182818284590452354
#define M_LOG2E   1.4426950408889634074
#define M_LOG10E   0.43429448190325182765
#define M_LN2   0.69314718055994530942
#define M_LN10   2.30258509299404568402
#define MAXFLOAT   ((float)3.40282347e+38)
#define sqrtf(a)   ((float)sqrt(a))
#define powf(a, b)   ((float)pow(a, b))
#define cosf(a)   ((float)cos(a))
#define sinf(a)   ((float)sin(a))
#define acosf(a)   ((float)acos(a))
#define asinf(a)   ((float)asin(a))
#define atan2f(a, b)   ((float)atan2(a, b))
#define tanf(a)   ((float)tan(a))
#define atanf(a)   ((float)atan(a))
#define floorf(a)   ((float)floor(a))
#define ceilf(a)   ((float)ceil(a))
#define fabsf(a)   ((float)fabs(a))
#define logf(a)   ((float)log(a))
#define expf(a)   ((float)exp(a))
#define fmodf(a, b)   ((float)fmod(a, b))
#define hypotf(a, b)   ((float)hypot(a, b))
#define SWAP(type, a, b)   { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }
#define CLAMP(a, b, c)   if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c)

Functions

MINLINE float sqrt3f (float f)
MINLINE double sqrt3d (double d)
MINLINE float saacosf (float f)
MINLINE float saasinf (float f)
MINLINE float sasqrtf (float f)
MINLINE float saacos (float fac)
MINLINE float saasin (float fac)
MINLINE float sasqrt (float fac)
MINLINE float interpf (float a, float b, float t)
MINLINE float minf (float a, float b)
MINLINE float maxf (float a, float b)
MINLINE float signf (float f)
MINLINE float power_of_2 (float f)
MINLINE float shell_angle_to_dist (float angle)
double double_round (double x, int ndigits)

Detailed Description

Definition in file BLI_math_base.h.


Define Documentation

#define acosf (   a)    ((float)acos(a))

Definition at line 95 of file BLI_math_base.h.

Referenced by btAcos(), draw_rotation_guide(), and saacosf().

#define asinf (   a)    ((float)asin(a))

Definition at line 98 of file BLI_math_base.h.

Referenced by btAsin(), flyApply_ndof(), and saasinf().

#define atan2f (   a,
 
)    ((float)atan2(a, b))
#define atanf (   a)    ((float)atan(a))

Definition at line 107 of file BLI_math_base.h.

Referenced by btAtan(), drawmball(), lens_to_angle(), and vectorscope_draw_target().

#define ceilf (   a)    ((float)ceil(a))
#define CLAMP (   a,
  b,
 
)    if((a)<(b)) (a)=(b); else if((a)>(c)) (a)=(c)

Definition at line 144 of file BLI_math_base.h.

#define cosf (   a)    ((float)cos(a))
#define expf (   a)    ((float)exp(a))
#define fabsf (   a)    ((float)fabs(a))

Definition at line 116 of file BLI_math_base.h.

Referenced by alter_co(), applyModifier(), area_poly_v3(), area_tri_v2(), axisProjection(), b_bone_spline_setup(), barycentric_weights(), btFabs(), check_zone(), cmp_uv(), compare_v3v3(), compare_v4v4(), compatible_bump_compute(), compatible_bump_uv_derivs(), cuboid_do(), dist_to_line_v2(), do_displace(), do_material_tex(), do_versions(), draw_bb_quadric(), draw_ptcache_edit(), draw_rotation_guide(), draw_uvs_stretch(), draw_view_axis(), drawlamp(), edgetag_cut_cost(), EM_make_uv_vert_map(), esubdivideflag(), extrudeflag_edge(), extrudeflag_vert(), ff_visible_quad(), find_nearest_uv_vert(), find_vertex_tangent(), flyApply(), flyApply_ndof(), get_graph_keyframe_extents(), gp_draw_stroke_3d(), gp_draw_stroke_buffer(), graphkeys_euler_filter_exec(), handleNumInput(), InitTriInfo(), invert_m4_m4(), is_orthogonal_m3(), is_orthogonal_m4(), isect_sweeping_sphere_tri_v3(), line_clip_rect2f(), line_isect_x(), line_isect_y(), make_uv_vert_map(), measure_facepair(), mixImages(), my_get_local_bounds(), nearest_point_in_tri_surface(), NotZero(), nr_distance_to_edge(), object_get_dimensions(), occ_visible_quad(), p_edge_implicit_seam(), paint_calc_object_space_radius(), param_average(), precalc_wipe_zone(), project_brush_radius(), project_bucket_clip_face(), project_from_view(), psys_get_birth_coordinates(), psys_get_texture(), quat_to_axis_angle(), quat_to_mat3(), quat_to_mat4(), ramp_blend(), rasterize_half(), sculpt_clip(), select_linked_flat_faces(), select_sharp_edges_exec(), shell_angle_to_dist(), similar_edge_select__internal(), similar_face_select__internal(), simpleDeform_bend(), smooth_vertex(), splineik_evaluate_bone(), sticky_select(), sum_or_add_vertex_tangent(), svd_m4(), texture_value_blend(), ui_numedit_but_NUM(), UI_view2d_listview_view_to_cell(), and waveModifier_do().

#define floorf (   a)    ((float)floor(a))
#define fmodf (   a,
 
)    ((float)fmod(a, b))
#define hypotf (   a,
 
)    ((float)hypot(a, b))

Definition at line 128 of file BLI_math_base.h.

Referenced by svd_m4().

#define logf (   a)    ((float)log(a))

Definition at line 119 of file BLI_math_base.h.

Referenced by btLog(), imagewraposa_aniso(), messageOutputFunc(), and Exception::report().

#define M_1_PI   0.318309886183790671538

Definition at line 59 of file BLI_math_base.h.

Referenced by GetSkyXYZRadiance().

#define M_E   2.7182818284590452354

Definition at line 62 of file BLI_math_base.h.

#define M_LN10   2.30258509299404568402

Definition at line 74 of file BLI_math_base.h.

Referenced by soft_range_round_down(), and soft_range_round_up().

#define M_LN2   0.69314718055994530942
#define M_LOG10E   0.43429448190325182765

Definition at line 68 of file BLI_math_base.h.

#define M_LOG2E   1.4426950408889634074

Definition at line 65 of file BLI_math_base.h.

Referenced by imagewraposa_aniso().

#define M_PI   3.14159265358979323846

Definition at line 47 of file BLI_math_base.h.

#define M_PI_2   1.57079632679489661923
#define M_SQRT1_2   0.70710678118654752440

Definition at line 56 of file BLI_math_base.h.

Referenced by calctrackballvec().

#define M_SQRT2   1.41421356237309504880
#define MAXFLOAT   ((float)3.40282347e+38)
#define powf (   a,
 
)    ((float)pow(a, b))
#define sinf (   a)    ((float)sin(a))
#define sqrtf (   a)    ((float)sqrt(a))
#define SWAP (   type,
  a,
 
)    { type sw_ap; sw_ap=(a); (a)=(b); (b)=sw_ap; }

Definition at line 140 of file BLI_math_base.h.

Referenced by adduplicateflagNurb(), applyModifier(), area_copy_data(), armature_click_extrude_exec(), armature_extrude_exec(), bake_rasterize(), BKE_nlastrips_has_space(), BKE_nlatrack_has_space(), buf_rectfill_area(), bvh_partition(), change_sequence(), curvemapping_do_ibuf(), deleteflagNurb(), do_2d_mapping(), do_grab_brush(), do_strand_fillac(), doMirrorOnAxis(), drawviewborder_triangle(), dvert_mirror_op(), edge_rotate(), filldisplist(), flipface(), getLowestRoot(), imagewraposa(), imagewraposa_aniso(), imapaint_canvas_set(), IMB_flipx(), interp_weights_face_v3(), invert_m4_m4(), isect_seg_seg_v2_point(), isect_sweeping_sphere_tri_v3(), kdtree_balance(), make_edges_mdata(), makeBevelList(), mesh_get_x_mirror_faces(), multiple_scattering_diffusion(), node_composit_exec_bilateralblur(), node_update(), ob_parcurve(), occ_build_split(), old_mdisps_convert(), partition_indices(), rasterize_half(), RE_SwapResult(), RE_zbuf_accumulate_vecblur(), rotate_direction_nurb(), seq_swap(), setup_app_data(), shadeSkyView(), sort_time_beztmaps(), sort_time_fcurve(), swap_v2_v2(), swap_v3_v3(), swap_v4_v4(), switchdirection_knots(), switchdirectionNurb(), test_index_face(), texture_value_blend(), to_edgesort(), ui_but_update_from_old_block(), ui_but_update_linklines(), uiBlockFlipOrder(), uiWidgetScrollDraw(), undo_copy_tile(), viewdolly_apply(), viewzoom_apply(), widget_numbut(), widget_numslider(), widget_state(), widget_state_numslider(), widget_textbut(), zbuffer_transp_shade(), zbufshade_tile(), and zbufshadeDA_tile().

#define tanf (   a)    ((float)tan(a))

Definition at line 104 of file BLI_math_base.h.

Referenced by angle_to_lens(), btTan(), and project_camera_info().


Function Documentation

double double_round ( double  x,
int  ndigits 
)

Definition at line 67 of file math_base.c.

References fabs(), pow(), and round().

Referenced by Color_ToTupleExt(), Euler_ToTupleExt(), Quaternion_to_tuple_ext(), and Vector_to_tuple_ext().

MINLINE float interpf ( float  a,
float  b,
float  t 
)
MINLINE float maxf ( float  a,
float  b 
)
MINLINE float minf ( float  a,
float  b 
)

Definition at line 120 of file math_base_inline.c.

Referenced by gjkepa2_impl::EPA::findbest(), isect_seg_seg_v2_point(), and svd_m4().

MINLINE float power_of_2 ( float  f)

Definition at line 115 of file math_base_inline.c.

References KDL::log(), M_LN2, and pow().

Referenced by sequencer_view_all_preview_exec(), and view_all_exec().

MINLINE float saacos ( float  fac)
MINLINE float saacosf ( float  f)

Definition at line 80 of file math_base_inline.c.

References acosf, and M_PI.

Referenced by ff_quad_form_factor(), and occ_quad_form_factor().

MINLINE float saasin ( float  fac)

Definition at line 67 of file math_base_inline.c.

References KDL::asin(), and M_PI.

Referenced by angle_normalized_v2v2(), and angle_normalized_v3v3().

MINLINE float saasinf ( float  f)

Definition at line 87 of file math_base_inline.c.

References asinf, and M_PI.

MINLINE float sasqrt ( float  fac)
MINLINE float sasqrtf ( float  f)

Definition at line 94 of file math_base_inline.c.

References sqrtf.

MINLINE float shell_angle_to_dist ( float  angle)

Definition at line 109 of file math_base_inline.c.

References cosf, fabsf, and SMALL_NUMBER.

Referenced by applyModifier(), EM_solidify(), and uv_image_outset().

MINLINE float signf ( float  f)

Definition at line 130 of file math_base_inline.c.

Referenced by do_displace().

MINLINE double sqrt3d ( double  d)

Definition at line 53 of file math_base_inline.c.

References KDL::exp(), and KDL::log().

Referenced by findzero().

MINLINE float sqrt3f ( float  f)

Definition at line 46 of file math_base_inline.c.

References KDL::exp(), and KDL::log().

Referenced by ui_numedit_but_HSVCIRCLE().