From 1c6cabdf0f28f33233de20e719fd24744fd04cad Mon Sep 17 00:00:00 2001 From: Edward Zhang Date: Mon, 25 Dec 2023 23:17:44 -0800 Subject: [PATCH] minor bug/doc fixes --- src/attitude-utils.cpp | 4 ++-- src/io.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/attitude-utils.cpp b/src/attitude-utils.cpp index 9921a0e4..ce08be3f 100644 --- a/src/attitude-utils.cpp +++ b/src/attitude-utils.cpp @@ -202,7 +202,7 @@ decimal Vec3::operator*(const Vec3 &other) const { return DECIMAL_FMA(x,other.x, DECIMAL_FMA(y,other.y, z*other.z)); } -/// Dot product +/// Vector-Scalar multiplication Vec2 Vec2::operator*(const decimal &other) const { return { x*other, y*other }; } @@ -217,7 +217,7 @@ Vec2 Vec2::operator+(const Vec2 &other) const { return {x + other.x, y + other.y }; } -/// Usual vector addition +/// Usual vector subtraction Vec2 Vec2::operator-(const Vec2 &other) const { return { x - other.x, y - other.y }; } diff --git a/src/io.cpp b/src/io.cpp index 389f14cc..e385190b 100644 --- a/src/io.cpp +++ b/src/io.cpp @@ -109,7 +109,7 @@ const Catalog &CatalogRead() { std::sort(catalog.begin(), catalog.end(), [](const CatalogStar &a, const CatalogStar &b) { return a.spatial.x < b.spatial.x; }); - for (int i = catalog.size(); i > 0; i--) { + for (int i = catalog.size()-1; i > 0; i--) { if ((catalog[i].spatial - catalog[i-1].spatial).Magnitude() < DECIMAL(5e-5)) { // 70 stars removed at this threshold. if (catalog[i].magnitude > catalog[i-1].magnitude) { catalog.erase(catalog.begin() + i);