From 9d20024aa35cd7f923ebfc1ed9a2ffbf2731da70 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Thu, 5 Nov 2009 21:02:40 +0000 Subject: Initial import. --- src/sims/util/Polar.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 src/sims/util/Polar.scala (limited to 'src/sims/util/Polar.scala') diff --git a/src/sims/util/Polar.scala b/src/sims/util/Polar.scala new file mode 100644 index 0000000..931be08 --- /dev/null +++ b/src/sims/util/Polar.scala @@ -0,0 +1,17 @@ +/* + * Simple Mechanics Simulator (SiMS) + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package sims.util + +import sims.geometry._ +import scala.Math._ + +/**Polare Koordinaten.*/ +case class Polar(distance: Double, angle: Double) { + + /**Ergibt die Vektorrepraesantation dieser polaren Koordinaten.*/ + def toCarthesian = Vector2D(distance * sin(angle), distance * cos(angle)) +} -- cgit v1.2.3