about summary refs log tree commit diff
path: root/star.go
diff options
context:
space:
mode:
Diffstat (limited to 'star.go')
-rw-r--r--star.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/star.go b/star.go
index 2255a69..3a7f66e 100644
--- a/star.go
+++ b/star.go
@@ -7,6 +7,10 @@ type Star2D struct {
 	M float64 // mass        of the star
 }
 
+func NewStar2D(c Vec2, v Vec2, m float64) Star2D {
+	return Star2D{C: c, V: v, M: m}
+}
+
 // InsideOf is a method that tests if the star it is applied on is in or outside of the given
 // BoundingBox. It returns true if the star is inside of the BoundingBox and false if it isn't.
 func (s Star2D) InsideOf(boundary BoundingBox) bool {