Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
| Comment: | Commit in haste: Repent at leisure. Fix reverse journey
Had not actually tried out my changes, or, it seems, used my brain at all - Can't simply just add Pi on, need to keep it within 2*Pi limit |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk | origin/master |
| Files: | files | file ages | folders |
| SHA3-256: |
3022ce9541de760391006547badd28ad |
| User & Date: | base@atomicules.co.uk 2014-12-12 12:49:17 |
|
2014-12-12
| ||
| 12:49 |
Bug fix - Forgetting than list indexes start at 1
Which means I also need to wrap around the list if I get 16 segments. This means I probably could have just simply added Pi (previous commit) | |
| 12:49 |
Commit in haste: Repent at leisure. Fix reverse journey
Had not actually tried out my changes, or, it seems, used my brain at all - Can't simply just add Pi on, need to keep it within 2*Pi limit | |
|
2014-12-11
| ||
| 22:37 |
Handle the reverse route
I don't want to have to query OSRM for th ereverse route - it's In order to do this made sense to re-jig some of the functions a bit: - Need date and time at top level, not buried in get_weather since | |
Changes to headsilose.erl.
| ︙ | ︙ | |||
188 189 190 191 192 193 194 | end, Distance_headings_list). reverse_journey(Distance_headings_list) -> %Don't actually need a correctly ordered reverse route, as long as we have directions and distances. lists:map( | | > > > > > > > | | | 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 |
end,
Distance_headings_list).
reverse_journey(Distance_headings_list) ->
%Don't actually need a correctly ordered reverse route, as long as we have directions and distances.
lists:map(
fun({Distance, Heading}) ->
%Because can't have functions in guards
Pi = math:pi(),
Reverse_heading = if Heading < Pi ->
Heading + Pi;
Heading >= Pi ->
Heading - Pi
end,
Compass_direction = get_compass_direction_for(Reverse_heading),
{Distance, Compass_direction}
end,
Distance_headings_list).
get_compass_direction_for(Heading) ->
%In a way this is a waste of time as could just do headwind, etc based on angles, but since already have some code, why not?
Segment = 2*math:pi()/16,
|
| ︙ | ︙ |