Skip to content

Commit

Permalink
Start star number form 0
Browse files Browse the repository at this point in the history
  • Loading branch information
evgenyneu committed Aug 13, 2020
1 parent ae4fb8c commit 740942e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions js/physics/initial_conditions.js
Original file line number Diff line number Diff line change
Expand Up @@ -145,10 +145,10 @@ export function galaxyStarsPositionsAndVelocities(args) {
let starSpeed = Math.sqrt(args.coreMass / distanceFromCenter);

// Loop over all the stars in the current ring
for(let starNumber = 1; starNumber <= numberOfStars; starNumber++) {
for(let starNumber = 0; starNumber < numberOfStars; starNumber++) {
// Find the angle of the current star relative to the first
// star in the ring
let starAngle = (starNumber - 1) * angleBetweenNeighbours;
let starAngle = starNumber * angleBetweenNeighbours;

// Calculate the position of the current star relative to galaxy's centre
positions[iStar * 3] = distanceFromCenter * Math.cos(starAngle) *
Expand Down

0 comments on commit 740942e

Please sign in to comment.