Skip to content

Commit

Permalink
Negative sign fix (bits-and-electrons#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
saich08 authored Feb 21, 2021
1 parent f928da7 commit 619d535
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/quantum/quantum_state.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,24 @@ class QuantumState {
this.z = Math.cos(THREE.Math.degToRad(this.theta));
}

round() {
this.theta = parseFloat(this.theta.toFixed(4));
this.phi = parseFloat(this.phi.toFixed(4));

this.alpha = parseFloat(this.alpha.toFixed(4));
this.beta = parseFloat(this.beta.toFixed(4));

this.x = parseFloat(this.x.toFixed(4));
this.y = parseFloat(this.y.toFixed(4));
this.z = parseFloat(this.z.toFixed(4));
}

update(theta, phi) {
this.theta = theta;
this.phi = phi;

this.load();
this.round();
}
}

Expand Down

0 comments on commit 619d535

Please sign in to comment.