Advertisement
GreenBytes

eqqwe

Sep 16th, 2020
2,411
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. Procedure vecRight(Vec.f, Ang.f, pAng.f)
  3.   Protected A.f, B.f
  4.   A = (Vec + Ang)
  5.   If A >= 360
  6.     If (pAng >= Vec And pAng <= 360.0)
  7.       ProcedureReturn 1
  8.     EndIf
  9.     B = (A - 360.0)
  10.     If (pAng >= 0.0 And pAng <= B)
  11.       ProcedureReturn 1
  12.     EndIf
  13.   Else
  14.     If (pAng >= Vec And pAng <= A)
  15.       ProcedureReturn 1
  16.     EndIf
  17.   EndIf
  18.   ProcedureReturn 0
  19. EndProcedure
  20.  
  21. Procedure vecLeft(Vec.f, Ang.f, pAng.f)
  22.   Protected A.f
  23.   A = (Vec - Ang)
  24.   If A <= 0
  25.     If pAng >= 0 And pAng <= Vec
  26.       ProcedureReturn 1
  27.     EndIf
  28.     B = (360.0 + A)
  29.     If pAng >= B And pAng <= 360.0
  30.       ProcedureReturn 1
  31.     EndIf
  32.   Else
  33.     If (pAng >= Vec And pAng <= A)
  34.       ProcedureReturn 1
  35.     EndIf
  36.   EndIf
  37. EndProcedure
  38.  
  39. Procedure vecPoint(Vec.f, Lang.f, Rand.f, pAng.f)
  40.   If vecRight(Vec.f, Rang.f, pAng.f)
  41.     ProcedureReturn 1
  42.   EndIf
  43.   If vecLeft(Vec.f, Lang.f, pAng.f)
  44.     ProcedureReturn 1
  45.   EndIf
  46.   ProcedureReturn 0
  47. EndProcedure
  48.  
  49. Vec.f = 21.0 ; // Куда я двигаюсь
  50. Rang.f = 20.0
  51. Lang.f = 20.0
  52. pAng.f = 13.0
  53.  
  54.  
  55. Debug vecPoint(Vec.f, Lang.f, Rand.f, pAng.f)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement