andmed, $ux); array_push($this->andmed, $uy); if($uz!=null){ array_push($this->andmed, $uy); } } function kysiX(){ return $this->andmed[0]; } function kysiY(){ return $this->andmed[1]; } function liida($teine){ return new Vektor( $this->kysiX()+$teine->kysiX(), $this->kysiY()+$teine->kysiY()); } function vastandVektor(){ return new Vektor(-$this->kysiX(), -$this->kysiY()); } } ?>