begin process at 2012 02 16 00:35:26
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Graphique

 > TRACÉ D'ÉTOILES

TRACÉ D'ÉTOILES


 Information sur la source

Note :
6 / 10 - par 3 personnes
6,00 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Graphique Classé sous :etoile Niveau :Initié Date de création :13/08/2001 Vu :3 542

Auteur : ceyquem

Ecrire un message privé
Site perso
Commentaire sur cette source (0)
Ajouter un commentaire et/ou une note

 Description

Ce code trace une étoile centrée en (x0,y0), à n branches, de rayon r et d'angle initial a.

Source

  • If n / 2 = Int(n / 2) Then
  • Px = r * Cos(a) + x0
  • Py = r * Sin(a) + y0
  • For j = 1 To n / 2
  • Px2 = r * Cos(a + 4 * Pi * j / n) + x0
  • Py2 = r * Sin(a + 4 * Pi * j / n) + y0
  • Picture1.Line (Px, Py)-(Px2, Py2)
  • Picture1.Line (Px, Py)-(Px2, Py2)
  • txtLaTeX.Text = txtLaTeX.Text & vbCrLf & "\put(" & Px & "," & Py & "){\line{...}}"
  • Px = Px2
  • Py = Py2
  • Next j
  • Px = r * Cos(a + 2 * Pi / n) + x0
  • Py = r * Sin(a + 2 * Pi / n) + y0
  • For j = 1 To n / 2
  • Px2 = r * Cos(a + 2 * Pi / n + 4 * Pi * j / n) + x0
  • Py2 = r * Sin(a + 2 * Pi / n + 4 * Pi * j / n) + y0
  • Picture1.Line (Px, Py)-(Px2, Py2)
  • Picture1.Line (Px, Py)-(Px2, Py2)
  • txtLaTeX.Text = txtLaTeX.Text & vbCrLf & "\put(" & Px & "," & Py & "){\line{...}}"
  • Px = Px2
  • Py = Py2
  • Next j
  • Else
  • Px = r * Cos(a) + x0
  • Py = r * Sin(a) + y0
  • For j = 1 To n
  • Px2 = r * Cos(a + 2 * Pi * j * (n - 1) / 2 / n) + x0
  • Py2 = r * Sin(a + 2 * Pi * j * (n - 1) / 2 / n) + y0
  • Picture1.Line (Px, Py)-(Px2, Py2)
  • txtLaTeX.Text = txtLaTeX.Text & vbCrLf & "\put(" & Px & "," & Py & "){\line{...}}"
  • Px = Px2
  • Py = Py2
  • Next j
  • End If
If n / 2 = Int(n / 2) Then
    Px = r * Cos(a) + x0
    Py = r * Sin(a) + y0
    For j = 1 To n / 2
        Px2 = r * Cos(a + 4 * Pi * j / n) + x0
        Py2 = r * Sin(a + 4 * Pi * j / n) + y0
        Picture1.Line (Px, Py)-(Px2, Py2)
        Picture1.Line (Px, Py)-(Px2, Py2)
        txtLaTeX.Text = txtLaTeX.Text & vbCrLf & "\put(" & Px & "," & Py & "){\line{...}}"
        Px = Px2
        Py = Py2
    Next j
    Px = r * Cos(a + 2 * Pi / n) + x0
    Py = r * Sin(a + 2 * Pi / n) + y0
    For j = 1 To n / 2
        Px2 = r * Cos(a + 2 * Pi / n + 4 * Pi * j / n) + x0
        Py2 = r * Sin(a + 2 * Pi / n + 4 * Pi * j / n) + y0
        Picture1.Line (Px, Py)-(Px2, Py2)
        Picture1.Line (Px, Py)-(Px2, Py2)
        txtLaTeX.Text = txtLaTeX.Text & vbCrLf & "\put(" & Px & "," & Py & "){\line{...}}"
        Px = Px2
        Py = Py2
    Next j
Else
    Px = r * Cos(a) + x0
    Py = r * Sin(a) + y0
    For j = 1 To n
        Px2 = r * Cos(a + 2 * Pi * j * (n - 1) / 2 / n) + x0
        Py2 = r * Sin(a + 2 * Pi * j * (n - 1) / 2 / n) + y0
        Picture1.Line (Px, Py)-(Px2, Py2)
        txtLaTeX.Text = txtLaTeX.Text & vbCrLf & "\put(" & Px & "," & Py & "){\line{...}}"
        Px = Px2
        Py = Py2
    Next j
End If 

 Conclusion

La sortie se fait sur une picturebox modifiée pour avoir un repère orthonormal direct.


 Sources du même auteur

Source avec Zip Source avec une capture COMPTER LES MOTS ET LA DIVERSITÉ
TRACÉ DE POLYGONE
MODULE MÉTÉO (NURMITE)
MODULE FOOD (NURMITE)
Source avec Zip Source avec une capture ALGÈBE LINÉAIRE

 Sources de la même categorie

Source avec Zip Source avec une capture Source .NET (Dotnet) VB10 - CRÉER VOS PROPRES CALQUES SUR UNE IMAGE par Duke49
Source avec Zip Source avec une capture Source .NET (Dotnet) CREER UN GIF ANIMÉ par Le Pivert
Source avec une capture GRAPH PHP COURBE DE CHARGE par s.defaye
Source avec Zip Source avec une capture BOULE DE CRISTAL par BLUEBIBUBBLE
VB6 - DÉPLACEMENT D'UN CONTRÔLE SUR UN SEGMENT DE DROITE DÉL... par ucfoutu

 Sources en rapport avec celle ci

Source avec Zip Source avec une capture ETOILE QUI ROULE N'AMMASE PAS MOUSSE... par Sultar
Source avec Zip DÉCODER LES ÉTOILES D'UN MOT DE PASSE par Warning
Source avec Zip Source avec une capture DES ÉTOILES QUI BOUGENT par Sylfeline
ETOILES 3D par LeKamé
CRÉER UN FOND ÉTOILÉ par msvbvm60.dll

Commentaires et avis

Aucun commentaire pour le moment.

 Ajouter un commentaire


Discussions en rapport avec ce code source dans le forum

Aide pour MACRO TABLE DE MULTIPLICATION [ par bencoco ] Bonjour, J'ai un soucis pour réussir à faire une macro VBA en utilisant Word : l'énoncé me demande faire une macro qui demande à l'utilisateur un nomb


Nos sponsors


Sondage...

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,108 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales