December 03, 2020, 08:04:21 PM

Author Topic: [bb] 2 point Angle difference by Nebula [ 1+ years ago ]  (Read 482 times)

Offline BlitzBot

  • Jr. Member
  • **
  • Posts: 1
[bb] 2 point Angle difference by Nebula [ 1+ years ago ]
« on: June 29, 2017, 12:28:39 AM »
Title : 2 point Angle difference
Author : Nebula
Posted : 1+ years ago

Description : 2 points on the screen. The angle difference is returned from the function.

Code :
Code: BlitzBasic
  1. Function volledigehoek#(x1,y1,x2,y2) ; x2 y2 naar
  2.         Local hoek = 0
  3.         Local laagste = 1024
  4.         For i=0 To 360
  5.                 x3 = x1+Cos(hoek) * 211
  6.                 y3 = y1+Sin(hoek) * 211
  7.                 hoek = hoek + 1
  8.                 nieuw = Sqr((x3-x2)^2+(y3-y2)^2)
  9.                 If nieuw < laagste Then laagste = nieuw : uitgraad = i
  10.         Next
  11.         Return uitgraad
  12. End Function


Comments :


Who was John Galt?(Posted 1+ years ago)

 Don't use this code, it's extremely slow and inaccurate.


 

SimplePortal 2.3.6 © 2008-2014, SimplePortal