kwik10z
11-29-2007, 05:09 AM
I just need some verification that i defined the variables correctly and that these triginometry functions are correct.
Sub Insert_TrigFunctions()
Dim XC As Integer, YC As Integer
' XC, YC are coordinates of center of IC chip
Dim XP As Integer, YP As Integer
' XP, YP are coordinates of center of pad relative to chip
Dim Rot As Double, DV As Double
' Rot is Rotation angle, DV is a vector -- distance between center of chip to center of pad
Dim XS As Intger, YS As Integer
' XS, YS are XY coordinates of solder dot
Dim THETA As Integer
' THETA is the angle of pad relative to center of chip
Set DV = Sqrt(XP ^ 2 + YP ^ 2)
' Equation to find the Vector
Set THETA = Degrees(ATAN(YP / XP))
' Equation to find THETA angle
Set YS = DV * Sin(Radians(THETA))
' Equation to give YS in radians rather than degrees
If XP < 0 Then
THETA = THETA + 180 ' If XP is less than 0, rotate the chip 180degrees
End If
End Sub
Thanks....the THETA is that if the angle is less than 0, rotate 180 degrees.
Sub Insert_TrigFunctions()
Dim XC As Integer, YC As Integer
' XC, YC are coordinates of center of IC chip
Dim XP As Integer, YP As Integer
' XP, YP are coordinates of center of pad relative to chip
Dim Rot As Double, DV As Double
' Rot is Rotation angle, DV is a vector -- distance between center of chip to center of pad
Dim XS As Intger, YS As Integer
' XS, YS are XY coordinates of solder dot
Dim THETA As Integer
' THETA is the angle of pad relative to center of chip
Set DV = Sqrt(XP ^ 2 + YP ^ 2)
' Equation to find the Vector
Set THETA = Degrees(ATAN(YP / XP))
' Equation to find THETA angle
Set YS = DV * Sin(Radians(THETA))
' Equation to give YS in radians rather than degrees
If XP < 0 Then
THETA = THETA + 180 ' If XP is less than 0, rotate the chip 180degrees
End If
End Sub
Thanks....the THETA is that if the angle is less than 0, rotate 180 degrees.