summaryrefslogblamecommitdiff
path: root/src/sims/util/Polar.scala
blob: c4009b5fdc8394924a12f1311cd76c29015add18 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11










                                       
                       

                                                   
                                                                    

                                                                           
/*
 * Simple Mechanics Simulator (SiMS)
 * copyright (c) 2009 Jakob Odersky
 * made available under the MIT License
*/

package sims.util

import sims.geometry._
import scala.Math._

/**Polar coordinates.*/
case class Polar(distance: Double, angle: Double) {
  
  /**Returns the vector representation of these polar coordinates.*/
  def toCarthesian = Vector2D(distance * sin(angle), distance * cos(angle))
}