Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //: Horizontal Intersection Of Point And Circle
- //: www.twitch.com/kanjicoder
- //: https://www.etsy.com/shop/DekTen
- //: ANIMATED_GIF_OF_THIS_CODE: https://imgur.com/gallery/wIPuIES
- //:COPIED_FROM[ R:\G\UP\MSB\SBF.SCAD ]===================://
- //:Circle_Line_Intersect:HORIZONTAL_RAY_FROM_POINT
- function SBF_CliHor(
- p_t
- , cen
- , rad
- )=([
- ( //:<<<<<<< h_x:HIT_X(intersection_x)
- ( cen[0]+SBF_IGT(p_t[0],cen[0])*cos( //:C_F:BEG
- asin((p_t[1]-cen[1])/rad) //:__ANG__
- )*rad ) //:<<<<<<<<<<<<<<<<<<<<<<<<<<<:C_F:END
- ) //:<<<<<<< h_x:HIT_X(intersection_x)
- ,
- p_t[1] //:Y_IS_SAME_FOR_HORIZONTAL_INTERSECTION
- ]);;
- //: IGT:Is_Greater_Than:
- //: TRUE: Return 0+1
- //: FALSE: Return 0-1
- function
- SBF_IGT( p_t , cen )=(
- p_t >= cen ? 0+1 :
- p_t < cen ? 0-1 : 0
- );;
- //:==================:COPIED_FROM[ R:\G\UP\MSB\SBF.SCAD ]://
Add Comment
Please, Sign In to add comment