Attribute VB_Name = "ModuleAggiustaTavola"
Option Explicit
Global Const PiGreco As Double = 3.14159265358979

Public lngCoordRef1X As Long
Public lngCoordRef1Y As Long
Public lngCoordRef2X As Long
Public lngCoordRef2Y As Long
Public lngCoordRef3X As Long
Public lngCoordRef3Y As Long
Public lngCoordRef4X As Long
Public lngCoordRef4Y As Long

Public lngDeltaX1 As Long
Public lngDeltaY1 As Long
Public lngDeltaX2 As Long
Public lngDeltaY2 As Long
Public lngDeltaX3 As Long
Public lngDeltaY3 As Long
Public lngDeltaX4 As Long
Public lngDeltaY4 As Long

Public CoordXCentroTavola As Long
Public CoordYCentroTavola As Long
Public CoordXFiducial1 As Long
Public CoordYFiducial1 As Long
Public CoordXFiducial2 As Long
Public CoordYFiducial2 As Long
Public NuovaCoordXReference As Long
Public NuovaCoordYReference As Long

Public dblDeltaX1 As Double
Public dblDeltaY1 As Double
Public dblDeltaX2 As Double
Public dblDeltaY2 As Double
Public dblDeltaX3 As Double
Public dblDeltaY3 As Double
Public dblDeltaX4 As Double
Public dblDeltaY4 As Double

Public dblAngolo1 As Double
Public dblAngolo2 As Double

Public dblIpotenusa1 As Double
Public dblIpotenusa2 As Double

Public dblFattoreCorrettivo As Double
Public dblValoreLettoMicrometro As Double

Public blnLetturaContinuaMicrometro As Boolean

Function ASin(dblAngolo As Double) As Double
'Arcsin(x) = Atn(x / Sqr(-x * x + 1))

ASin = Atn(dblAngolo / Sqr(-dblAngolo * dblAngolo + 1))

End Function

Function ACos(dblAngolo As Double) As Double
'Arccos(X) = Atn(-X / Sqr(-X * X + 1)) + 2 * Atn(1)

ACos = Atn(-dblAngolo / Sqr(-dblAngolo * dblAngolo + 1)) + 2 * Atn(1)

End Function




