HelloWorld: Cavité.php

File Cavité.php, 389 bytes (added by /C=FR/O=CNRS/OU=UMR8607/CN=Christian Arnault/emailAddress=arnault@…, 12 years ago)
Line 
1<?php
2
3class Cavité
4{
5  var $champ;
6  var $longueur;
7 
8  function Cavité ($champ, $longueur)
9    {
10      $this->champ = $champ;
11      $this->longueur = $longueur;
12    }
13
14  function accélère ($faisceau)
15    {
16      $sortie = new Faisceau ($faisceau->nom, $faisceau->twiss, $faisceau->énergie);
17
18      $sortie->énergie += $this->champ * $this->longueur;
19
20      return ($sortie);
21    }
22};
23
24?>