Skip to content

Commit

Permalink
Fixes in documentation. Some other smaller changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
alinnman committed Oct 6, 2024
1 parent cafa95b commit df40fb9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ Using two star fixes a sight reduction can be done in the following way
b = Sight (....Parameters....)

collection = SightCollection ([a, b])
intersections = collection.get_intersections ()
intersections, fitness = collection.get_intersections ()
print (get_representation(intersections,1))

The result will be a tuple of **two** coordinates (intersections of two circles
Expand Down Expand Up @@ -301,7 +301,7 @@ Using three (or more) sights a sight reduction can be done in the following way
c = Sight (....Parameters....)

collection = SightCollection ([a, b, c]) # Add more sights if needed
intersections = collection.getIntersections ()
intersections, fitness = collection.getIntersections ()
print (getRepresentation(intersections,1))

A *sight* is defined as a collection of data as described in the section 1 above,
Expand Down Expand Up @@ -423,7 +423,7 @@ See above for how to create a sight object

Now you can calculate the coordinates for this trip.

intersections = st.get_intersections ()
intersections, fitness = st.get_intersections ()
print ("Starting point = " + str(get_representation(intersections[0],1)))
print ("End point = " + str(get_representation(intersections[1],1)))

Expand Down
24 changes: 12 additions & 12 deletions starfix.py
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ def get_intersections (latlon1 : LatLon, latlon2 : LatLon,\
int1 = normalize_vect(rotate_vector (q, rot_axis, rho))
int2 = normalize_vect(rotate_vector (q, rot_axis, -rho))

# Calculate fitness of intersections. TODO
# Calculate fitness of intersections.
fitness = 1
if use_fitness:
d1 = add_vecs (int1, mult_scalar_vect(-1,a_vec))
Expand All @@ -284,17 +284,17 @@ def get_intersections (latlon1 : LatLon, latlon2 : LatLon,\
ret_tuple = (to_latlon(int1), to_latlon(int2))
if estimated_position is None:
return ret_tuple, fitness
else:
# Check which of the intersections is closest to our estimatedCoordinates
best_distance = EARTH_CIRCUMFERENCE
best_intersection = None
for ints in ret_tuple:
the_distance = distance_between_points (ints, estimated_position)
if the_distance < best_distance:
best_distance = the_distance
best_intersection = ints
assert best_intersection is not None
return best_intersection, fitness

# Check which of the intersections is closest to our estimatedCoordinates
best_distance = EARTH_CIRCUMFERENCE
best_intersection = None
for ints in ret_tuple:
the_distance = distance_between_points (ints, estimated_position)
if the_distance < best_distance:
best_distance = the_distance
best_intersection = ints
assert best_intersection is not None
return best_intersection, fitness

# Atmospheric refraction

Expand Down

0 comments on commit df40fb9

Please sign in to comment.