Commit 2f2ea51e authored by legoc's avatar legoc
Browse files

Corrected bug with ki, kf trajectories

parent 927c2de2
const { matrix } = require('../../server-state');
/**
* Class defining the trajectory circle iterator.
*/
class TrajectoryCircleIterator {
constructor(center, start, end, intervals) {
this._currentPosition = start.clone();
this._center = center.clone();
let CS = start.clone().sub(center);
let CE = end.clone().sub(center);
// The vectors center, start and end are in Rc.
// They must be converted into R to calculate the circle.
this._currentPosition = start.clone().applyMatrix3(matrix.bMatrix);
this._center = center.clone().applyMatrix3(matrix.bMatrix);
this._end = end.clone().applyMatrix3(matrix.bMatrix);
let CS = this._currentPosition.clone().sub(this._center);
let CE = this._end.clone().sub(this._center);
this._axis = CS.clone().cross(CE).normalize();
this._step = CS.angleTo(CE) / intervals;
......@@ -15,7 +21,8 @@ class TrajectoryCircleIterator {
}
value() {
return this._currentPosition.clone();
// The result vector is converted back in Rc.
return this._currentPosition.clone().applyMatrix3(matrix.bMatrix_1);
}
next() {
......
......@@ -218,7 +218,7 @@ class ScatteringPanelView {
}
/**
* Updates the points with the new ki value.
* Updates the points with the new ki or kf value.
*/
updateQKiKf(ki, kf, qh, qk, ql, qnorm, ss) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment