Facebook

Login

Support Sailonline

If you haven't already - join the SAILONLINE YACHT CLUB!

Please also consider making a donation - all amounts are greatly appreciated!

Board » General Discussion » Circular Math

Working on a Spreadsheet function to give the correct TWA that matches what the SOL game client displays. I happen to use LibreOffice so this is how it looks for me.

The structure is a common IF, THEN, ELSE format.

=IF((TWD-COG)<=-180,(TWD-COG)+360,
IF((TWD-COG)>180,(TWD-COG)-360,
(TWD-COG)))

I was curious if anyone could suggest a simpler or more elegant way to do the same thing ?

Beyond that if you happen to have any other Algorithms that are useful for SOL problems please share them here.
None so blind
=MOD(TWD-COG+180,360)-180

Even allows values like 365 or -70 for TWD and COG.

_____________________
+1 for LibreOffice ;)

--- Last Edited by kroppyer at 2013-10-28 22:15:06 ---
Very Clever ~ I was familiar with the term Modulo but had never applied it to anything before. Now I can turn my spreadsheet into a circular slide rule or Whiz Wheel.
None so blind
[removed at the suggestion it was off-topic]

--- Last Edited by LaoziSailor (Han Tacoma-Emons) at 2013-10-29 22:59:20 ---
LaoziSailor

Everything gets done by not doing anything!

Please login to post a reply.

Races

Next Race: 00d 00h 00m


Current Races:

Tall Ships 2026 - Stavanger to Aalborg


Welcome to the fourth of four virtual Tall Ships Races in European waters which are concurrently being organized in-real-life by Sail Training International . This fourth race is from Stavanger in Norway into the Skaggerak to a finish off Denmark’s Aalborg and perhaps an Aquavit to toast the adventure afterwards – a final circa 250nm in Sailonline’s classic Clipper 240.
NOTE: Starts and Finishes in tall ships racing are always offshore to avoid conflict with shipping and shipping lanes; online and real-life may not match exactly.
Race #1995
INFO by brainaid.de
Clipper 240 PARTICULARS
WX Updates:
0430 / 1030 / 1630 / 2230
Ranking: TSI - SUPBUD - SYC
Race starts: Jul 25th 16:00 Registration Open!
▶ Flash
GO TO RACE

Chinook Salmon - Canada to Andreanovs


A year after spawning in the upper reaches of the rivers of British Columbia, Chinook Salmon develop the age-old urge, so familiar to SOLers, to go to sea, heading for different parts of the northern Pacific Ocean. This race catches up with a particular school with an instinctive memory for the Andreanov Islands far west on the Aleutian Islands chain, as they depart the Salian Sea between Vancouver Island and the San Juans. It’s 2200nm and we’re taking the 60ft Trimaran, in the hope we can keep up!
Race #2048
INFOby brainaid.de
60ft Trimaran PARTICULARS
WX Updates:
0430 / 1030 / 1630 / 2230
Ranking: MIG - SYC
Race starts: Jul 21st 11:00 Registration Open!
▶ Flash
GO TO RACE

Juventud TIMED Race 2026

Welcome to Isla de la Juventud (Isle of Youth), Cuba’s second largest island after mainland Cuba. Known as a haven for pirates, the island was the inspiration for novels “Treasure Island” and “Peter Pan”. The circa 120nm course runs clockwise around the island.
This is a TIMEDrace so you may RE-REGISTER HEREto try again after finishing a run. You will have two weeks to test your skill and decision making after the race opens.
Race #2049
INFOby brainaid.de
The boat for this race is the sporty Mini 6.5p Foil PARTICULARS
WX Updates:
0430 / 1030 / 1630 / 2230
Ranking:
TRQ3 - TRCH - SYC
RACE CLOSE: Saturday,
1 August at 23:00 UTC
Race starts: Jul 19th 12:00 Registration Open!
▶ Flash
GO TO RACE

Alaska to Easter Island 2026

Welcome to yet another all-new series. The initial leg of the RNW (Round the New World), Alaska to Easter Island, also part of our Ocean Championship. The first race of OCQ3 2026. This race will be sailed in our revised 'version 2' Imoca 60 Foil. Race #2042
INFO by brainaid.de
Imoca 60 Foil v2 PARTICULARS
WX Updates:
0430 / 1030 / 1630 / 2230
Ranking: OCQ3 - RNW - OCCH - SYC
Race starts: Jul 06th 11:00 Registration Closed
▶ Flash
GO TO RACE

Go to race archive

SYC Ranking

  1. Sailonline Yacht Club Member KaSToR
  2. Sailonline Yacht Club Member WRmirekd
  3. Sailonline Yacht Club Member CriticalHippo
  4. Sailonline Yacht Club Member Panpyc
  5. Sailonline Yacht Club Member cdhinman
  6. Sailonline Yacht Club Member bonknhoot
  7. Sailonline Yacht Club Member rafa
  8. Sailonline Yacht Club Member ms0689
  9. Sailonline Yacht Club Member sassy63
  10. Sailonline Yacht Club Member ita10267

View full list

Series

Mobile Client

SYC members have the benefit of access to our mobile/lightweight web client!

The mobile client