geometry - Define a function for a circle caps the end of a line segment -
geometry - Define a function for a circle caps the end of a line segment -
i need function returns points on circle in 3 dimensions.
the circle should "cap" line segment defined points , b , it's radius. each cap perpendicular line segment. , centered @ 1 of endpoints.
here shitty diagram
let n unit vector in direction b, i.e., n = (b-a) / length(a-b). first step find 2 more vectors x , y such {n, x, y} form basis. means want 2 more vectors pairs of {n, x, y} perpendicular each other , unit vectors. way think want create new coordinate scheme x-axis lines line segment. need find vectors pointing in direction of y-axis , z-axis.
note there infinitely many choices x , y. need somehow find 2 work.
one way first find vectors {n, w, v} n above , w , v 2 of (1,0,0), (0,1,0), , (0,0,1). pick 2 vectors w , v correspond smallest coordinates of n. if n = (.31, .95, 0) pick (1,0,0) , (0,0,1) w , v. (math geek note: way of picking w , v ensures {n,w,v} spans r^3). apply gram-schmidt process {n, w, v} vectors {n, x, y} above. note need vector n first vector doesn't changed process.
so have 2 vectors perpendicular line segment , perpendicular each other. means points on circle around x * cos t + y * sin t + 0 <= t < 2 * pi. usual description of circle in 2 dimensions; written in new coordinate scheme described above.
geometry trigonometry space
Comments
Post a Comment