Skip to content

Commit

Permalink
Compound speed fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Smoren committed May 20, 2024
1 parent 3bcc703 commit 7269c29
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/analysis/compounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ export class CompoundsAnalyzer implements CompoundsAnalyzerSummary {

const speedVectors = [...compound].map((atom) => atom.speed);
const zeroVector = createVector(createFilledArray(speedVectors[0].length, 0));
return speedVectors.reduce((acc, vector) => acc.add(vector), zeroVector).abs / compound.size;
return speedVectors.reduce((acc, vector) => acc.add(vector), zeroVector).div(compound.size).abs;
}

private convertMapToArray<T>(map: Record<number, T[]>): Array<T[]> {
Expand Down

0 comments on commit 7269c29

Please sign in to comment.