534 |
|
|
535 |
|
trapezes = aire |
536 |
|
End Function |
537 |
+ |
|
538 |
+ |
|
539 |
+ |
|
540 |
|
Function IntegrationGauss(ByRef n As Integer, Optional ByRef noFunction As Integer = 1) As Double |
541 |
|
Dim i As Integer |
542 |
|
Dim temp As Double |
756 |
|
' function qui effectue la rotation d'un point Pt par le vecteur UNITAIRE u |
757 |
|
Public Function Rotation2D(ByRef u() As Double, ByVal Pt() As Double) As Double() |
758 |
|
Dim temp(1) As Double |
759 |
< |
Dim longueur As Double = Math.Sqrt(u(0) * u(0) + u(1) * u(1)) |
760 |
< |
u(0) /= longueur |
761 |
< |
u(1) /= longueur |
759 |
> |
'Dim longueur As Double = Math.Sqrt(u(0) * u(0) + u(1) * u(1)) |
760 |
> |
'u(0) /= longueur |
761 |
> |
'u(1) /= longueur |
762 |
> |
|
763 |
> |
Dim test(2) As Double |
764 |
> |
test(0) = 1 |
765 |
> |
'Debug.Print(Outils_Math.Angle2Vecteurs(test, u)) |
766 |
> |
'Debug.Print(Outils_Math.Angle2Vecteurs(test, Pt)) |
767 |
> |
|
768 |
> |
'temp(0) = u(0) * Pt(0) - u(1) * Pt(1) |
769 |
> |
'temp(1) = u(1) * Pt(0) + u(0) * Pt(1) |
770 |
> |
|
771 |
> |
'Debug.Print(Outils_Math.Angle2Vecteurs(test, temp)) |
772 |
> |
|
773 |
> |
Dim u2(2) As Double |
774 |
> |
u2(0) = u(0) |
775 |
> |
u2(1) = u(1) |
776 |
> |
Dim angleInit As Double = Math.Atan2(u(1), u(0)) |
777 |
> |
Dim anglePt As Double = Math.Atan2(Pt(1), Pt(0)) |
778 |
> |
Dim longueur As Double = Math.Sqrt(Pt(0) * Pt(0) + Pt(1) * Pt(1)) |
779 |
> |
|
780 |
> |
Dim anglefinal As Double = anglePt + angleInit |
781 |
> |
temp(0) = Math.Cos(anglefinal) * longueur |
782 |
> |
temp(1) = Math.Sin(anglefinal) * longueur |
783 |
|
|
784 |
< |
temp(0) = u(0) * Pt(0) - u(1) * Pt(1) |
761 |
< |
temp(1) = u(1) * Pt(0) + u(0) * Pt(1) |
784 |
> |
Return temp |
785 |
|
|
786 |
+ |
End Function |
787 |
|
|
788 |
|
|
789 |
< |
Return temp |
789 |
> |
'Private Function Angle2D(ByRef u() As Double) As Double |
790 |
> |
' If Math.Sign(u(0)) = 1 AndAlso Math.Sign(u(1)) = 1 Then |
791 |
> |
' Return (Math.Atan(u(1) / u(0))) |
792 |
> |
' ElseIf Math.Sign(u(0)) = -1 AndAlso Math.Sign(u(1)) = 1 Then ' 2nd quadrant |
793 |
> |
' Return (Math.Atan(u(1) / u(0))) |
794 |
> |
' ElseIf Math.Sign(u(0)) = -1 AndAlso Math.Sign(u(1)) = 1 Then ' 3ieme quadrant |
795 |
> |
' Return (Math.Atan(u(1) / u(0))) + 2 * Math.PI |
796 |
> |
' Else |
797 |
> |
' Return (Math.Atan(u(1) / u(0))) + 2 * Math.PI |
798 |
> |
' math. |
799 |
> |
' End If |
800 |
> |
'End Function |
801 |
|
|
767 |
– |
End Function |
802 |
|
|
803 |
|
Public Sub Rotation2D(ByRef u() As Double, ByRef Ptx As Double, ByRef Pty As Double) |
804 |
|
Dim temp(1) As Double |