Private Sub Form_Activate() Dim usa_surgace As Long, france_surface As Long, usa_shape As Shape, france_shape As Shape, pi As Double, k As Double pi = 3.14116 usa_surface = 9629047 france_surface = 551695 Set usa_shape = Shape1(0) Set france_shape = Shape1(1) usa_shape.Move 0, 0, 2200, 2200 Load Shape1(1) Set france_shape = Shape1(1) Shape1(1).Visible = True k = (Sqr(france_surface / pi)) / (Sqr(usa_surface / pi)) diametre_france = usa_shape.Width * k france_shape.Move usa_shape.Left + usa_shape.Width + 1000, 0, diametre_france, diametre_france france_shape.Visible = True End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questions1 = 1000
s2 = 2000
pi = 3.14116
r1 = Sqr(1000 / pi)
r2 = Sqr(2000 / pi)
MsgBox "les rayons sont : & vbcrlf & " & r1 & vbCrLf & r2 & vbCrLf & _
"preuve des surfaces : " & vbCrLf & pi * (r1 ^ 2) & vbCrLf & pi * (r2 ^ 2)
MsgBox pi * (r1 ^ 2)
Private Sub Form_Load()
Dim Ilong As Currency
Dim Pays1, Pays2 As String
Dim Super1, Super2 As Long
Dim Coul1, Coul2 As Long
'---------------------------------
Shape1(0).Height = 2200
Shape1(0).Width = 2200
Shape1(1).Height = 620
Shape1(1).Width = 620
'---------------------------------
Pays1 "Etats-Unis": Super1 9629047: Coul1 = 4210752 ' Shape1(0) .
Pays2 "France": Super2 551695: Coul2 = vbYellow ' Shape1(1) à calculer
'---------------------------------
'Ilong = Super1 / Super2 ' Rapport entre les 2 ~ 17 .
'Ilong = Super2 * Shape1(0).Width / Super1 ' 551695*2200/9629047 .
'Ilong = (Shape1(0).Width / Super1) * Super2 ' (2200 / 9629047) * 551695 .
Ilong = (Super2 / Super1) * Shape1(0).Width ' (551695/ 9629047) * 2200 .
Shape1(1).Height = Ilong
Shape1(1).Width = Ilong
Shape1(1).Move Shape1(0).Left + (Shape1(0).Width - Shape1(1).Width) / 2, Shape1(0).Top + (Shape1(0).Height - Shape1(1).Height) / 2
End Sub
r1 = r2* sqrt(S1/S2)
pi = 4 * Atn(1)