cf_intersect_halfspace¶
Category: math
GitHub: cute_math.h
Returns the intersection point of two points to a plane.
CF_V2 cf_intersect_halfspace(CF_V2 a, CF_V2 b, float da, float db) { float d = (da / (da - db)); CF_V2 ab = cf_sub(b, a); return cf_add(a, cf_v2(ab.x * d, ab.y * d)); }
Remarks¶
The distance to the plane are provided as da and db. You can compute these with e.g. cf_distance_hs, or instead
call the similar function cf_intersect_halfspace2.
Related Pages¶
CF_Halfspace
cf_plane
cf_origin
cf_distance_hs
cf_project
cf_mul_tf_hs
cf_mul_T_tf_hs
cf_intersect_halfspace3
cf_intersect_halfspace2