Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Attribute VB_Name = "basKealTrig"
- 'pi=3.14159263:for theta=0 to 1 step 1/64:print fix(theta*64),fix(kealtheta(cos(2*pi*theta),sin(2*pi*theta))*64):next theta
- Public Function KealTheta(tx As Variant, ty As Variant) As Double
- Dim tmpb As Double
- Dim x As Double, y As Double
- x = tx
- y = ty
- tmpb = CBoolSwitch(Abs(y) > Abs(x), Abs(y), Abs(x))
- Select Case tmpb
- Case 0
- Exit Function
- Case Else
- KealTheta = CBoolSwitch(tmpb = Abs(y), CBoolSwitch(y < 0, 6 * tmpb + x, 2 * tmpb - x), CBoolSwitch(x < 0, 4 * tmpb - y, CBoolSwitch(y < 0, 8 * tmpb + y, y))) / tmpb / 8
- End Select
- End Function
- Public Function KealResetX(x1 As Variant, y1 As Variant, y2 As Variant) As Double
- KealResetX = x1 * y2 / y1
- End Function
- Public Function KealResetY(x1 As Variant, y1 As Variant, x2 As Variant) As Double
- KealResetY = y1 * x2 / x1
- End Function
- Public Function KealOf1(Value As Variant) As Double
- KealOf1 = (1 + (Value - Fix(Value))) - Fix((1 + (Value - Fix(Value))))
- End Function
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement