DEKTEN

SBF_CliVer

Mar 24th, 2021 (edited)
285
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 1.09 KB | None | 0 0
  1.     //: Vertical Intersection Of Point And Circle
  2.     //: www.twitch.com/kanjicoder
  3.     //: https://www.etsy.com/shop/DekTen
  4.     //: ANIMATED_GIF_OF_THIS_CODE: https://imgur.com/gallery/wIPuIES
  5.  
  6.     //:COPIED_FROM[ R:\G\UP\MSB\SBF.SCAD ]===================://
  7.  
  8.         //:Circle_Line_Intersect:VERTICAL_RAY_FROM_POINT
  9.         function SBF_CliVer(
  10.             p_t
  11.         ,   cen
  12.         ,   rad
  13.         )=([
  14.             p_t[0] //:X_IS_SAME_FOR_VERTICAL_INTERSECTION
  15.             ,
  16.             ( //:<<<<<<< h_y:HIT_Y(intersection_y)
  17.  
  18.                 ( cen[1]+SBF_IGT(p_t[1],cen[1])*sin( //:C_F:BEG
  19.  
  20.                     acos((p_t[0]-cen[0])/rad)  //:__ANG__
  21.  
  22.                 )*rad )  //:<<<<<<<<<<<<<<<<<<<<<<<<<<<:C_F:END
  23.  
  24.             ) //:<<<<<<< h_y:HIT_Y(intersection_y)
  25.         ]);;
  26.  
  27.         //: IGT:Is_Greater_Than:
  28.         //:     TRUE: Return 0+1
  29.         //:    FALSE: Return 0-1
  30.         function
  31.         SBF_IGT( p_t , cen )=(
  32.  
  33.             p_t >= cen ? 0+1 :
  34.             p_t <  cen ? 0-1 : 0
  35.  
  36.         );;
  37.  
  38.     //:==================:COPIED_FROM[ R:\G\UP\MSB\SBF.SCAD ]://
Add Comment
Please, Sign In to add comment