diff --git a/CHANGELOG.md b/CHANGELOG.md index fba2bd395a3059aa2bdf0c80bad07cac523326d5..7948192c6b6035d5bcefbaeea80dd879303f8977 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Note that since we don't clearly distinguish between a public and private interf ## [Unreleased] Fix impostor bond visuals not correctly updating on `sizeFactor` changes +Fix degenerate case in PCA ## [v3.31.2] - 2023-02-12 diff --git a/src/mol-math/linear-algebra/matrix/principal-axes.ts b/src/mol-math/linear-algebra/matrix/principal-axes.ts index 1150702a448ad9341c3f844c9811f13b81995a1a..90091e1e123a20a112fb2439edf4ef1f9982e163 100644 --- a/src/mol-math/linear-algebra/matrix/principal-axes.ts +++ b/src/mol-math/linear-algebra/matrix/principal-axes.ts @@ -27,7 +27,7 @@ namespace PrincipalAxes { export function calculateMomentsAxes(positions: NumberArray): Axes3D { if (positions.length === 3) { - return Axes3D.create(Vec3.fromArray(Vec3(), positions, 0), Vec3.create(1, 0, 0), Vec3.create(0, 1, 0), Vec3.create(0, 1, 0)); + return Axes3D.create(Vec3.fromArray(Vec3(), positions, 0), Vec3.create(1, 0, 0), Vec3.create(0, 1, 0), Vec3.create(0, 0, 1)); } const points = Matrix.fromArray(positions, 3, positions.length / 3); @@ -143,4 +143,4 @@ namespace PrincipalAxes { return Axes3D.create(origin, dirA, dirB, dirC); } -} \ No newline at end of file +}