Skip to content

Commit

Permalink
Added getOverallLen()
Browse files Browse the repository at this point in the history
  • Loading branch information
deepnight committed Mar 28, 2024
1 parent 9d53ce9 commit 4db4c04
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/dn/phys/Velocity.hx
Original file line number Diff line number Diff line change
Expand Up @@ -295,25 +295,25 @@ class VelocityArray {
all = null;
}

/** Get the sum of all X values **/
public inline function getSumX() {
_sum = 0.;
for(v in all)
_sum+=v.x;
return _sum;
}

/** Get the sum of all Y values **/
public inline function getSumY() {
_sum = 0.;
for(v in all)
_sum+=v.y;
return _sum;
}

public inline function getSumLen() {
_sum = 0.;
for(v in all)
_sum+=v.len;
return _sum;
/** Get the overall "total" length of all vectors **/
public inline function getOverallLen() {
return Math.sqrt( getSumX()*getSumX() + getSumY()*getSumY() );
}

public inline function mulAll(f:Float) {
Expand Down

0 comments on commit 4db4c04

Please sign in to comment.