The DistanceDeterminationAlgorithm class houses the Distance Determination Algorithm.
More...
#include <distance.hpp>
The DistanceDeterminationAlgorithm class houses the Distance Determination Algorithm.
This algorithm calculates the distance from Earth based on the pixels of Earth's Edge found in the image.
- Note
- This class assumes that Earth is a perfect sphere
◆ SphericalDistanceDeterminationAlgorithm()
found::SphericalDistanceDeterminationAlgorithm::SphericalDistanceDeterminationAlgorithm |
( |
decimal |
radius, |
|
|
Camera && |
cam |
|
) |
| |
|
inline |
Creates a SphericalDeterminationAlgorithm, which deduces the Position vector of a sattelite from Earth by modeling Earth as a sphere.
- Parameters
-
radius | The radius of Earth |
cam | The camera used to capture the picture of Earth |
◆ ~SphericalDistanceDeterminationAlgorithm()
found::SphericalDistanceDeterminationAlgorithm::~SphericalDistanceDeterminationAlgorithm |
( |
| ) |
|
|
inline |
◆ getCenter()
Vec3 found::SphericalDistanceDeterminationAlgorithm::getCenter |
( |
Vec3 * |
spats | ) |
|
|
protected |
Returns the center of earth as a 3d Vector.
- Parameters
-
spats | The normalized spatial coordinates used to find the center |
- Returns
- The center of earth as a 3d Vector
CirclePt is a vector that points to a point on the plane. We also know the center vector should point to a point on the plane. So, we get (circlePt - center) * circleN = 0. This is equivalent to (center * circleN) = (circlePt * circleN)
We have (center - mid1/mid2) gives us the vector perpendicular to the mid1N/mid2N vector. Hence, (center - mid1)*mid1N = 0. This becomes (mid1N * center) = (mid1N * mid1). (This is the same for mid2) So we have: circleN * center = circleN * circlePt mid1N * center = mid1N * mid1 mid2N * center = mid2N * mid2 This becomes a systems of linear equation
◆ getDistance()
Returns the scaled distance from earth.
- Parameters
-
r | The normalized radius |
c | The distance to the center of the small circle |
- Returns
- The distance from earth as a Scalar
◆ getRadius()
Returns the radius of the calculated "earth" (normalized)
- Parameters
-
spats | The normalized spatial coordinates |
center | The center of the earth as a 3d Vector |
- Returns
- The radius of earth normalized
◆ Run()
Obtains the position of the planet relative to the camera.
- Parameters
-
p | The points on the edge of Earth (in the image taken by the camera given to this) |
- Returns
- PositionVector The position vector of the Earth relative to the camera
- Precondition
- p must refer to points taken by the camera that was passed to this
- Postcondition
- If p.size() < 3, then the result is exactly the zero vector
Implements found::Stage< Points, PositionVector >.
◆ cam_
Camera found::SphericalDistanceDeterminationAlgorithm::cam_ |
|
protected |
cam_ field instance describes the camera settings used for the photo taken
◆ radius_
decimal found::SphericalDistanceDeterminationAlgorithm::radius_ |
|
protected |
radius_ field instance describes the defined radius of earth.
Should be 6378.0 (km)
The documentation for this class was generated from the following files: