The C-Brats Forum Index
HomeForumsMy TopicsCalendarEvent SignupsMemberlistOur C-DorysThe Brat MapPhotos

Question:Relationshi between clock time & longitude/lati
Goto page Previous  1, 2
 
Post new topic   Reply to topic    The C-Brats Forum Index -> General Chat
View previous topic :: View next topic  
Author Message
Pedromo



Joined: 28 Apr 2013
Posts: 87
City/Region: Oxnard
State or Province: CA
C-Dory Year: 1989
C-Dory Model: 22 Cruiser
Vessel Name: C-Casa
Photos: C-Casa
PostPosted: Thu Jan 11, 2018 1:48 pm    Post subject: Reply with quote

Slocum also boiled his chronometer to keep it accurate 😉
Back to top
View user's profile Send private message Send e-mail
journey on



Joined: 03 Mar 2005
Posts: 3593
City/Region: Valley Centre
State or Province: CA
C-Dory Year: 2005
C-Dory Model: 25 Cruiser
Vessel Name: journey on
Photos: Journey On
PostPosted: Thu Jan 11, 2018 3:31 pm    Post subject: Reply with quote

Uh, I thought that was a one arm alarm clock. For navigation he used lunars, which don't require a chronometer.

In his trips story he sort of gives a running account of his alarm clock. I always wondered how he found his way and if you read real carefully, he tells you.

Boris
Back to top
View user's profile Send private message Visit poster's website
smittypaddler



Joined: 30 Jun 2004
Posts: 337
City/Region: Neenah, Wisconsin
State or Province: WI
C-Dory Year: 2004
C-Dory Model: 22 Cruiser
Vessel Name: Na Waqa
PostPosted: Sun Jan 14, 2018 1:44 pm    Post subject: daylight perl script Reply with quote

I wrote this perl script years ago, showing how daylight time changes in a sine curve. I found the equations somewhere on the internet:

#!/usr/bin/perl
# -----------------------------------------------------------------------
# Description: Calculates the hours of daylight, given a latitude and date.
# Syntax: daylight [yyyymmdd] [latitude]
# where -
# yyyymmdd is the date, which may be entered in any of the shortened
# forms dd, mmdd, or yymmdd. Any parts that are omitted use the
# current localtime as defaults.
# latitude is either the angle in degrees North of the equator, or
# the name of a limited list of cities (see $lat below). If omitted,
# the default is the latitude of Appleton, Wisconsin, 44.25 degrees.
# Uses an equation derived from David Toomey.
# -----------------------------------------------------------------------
# Changelog:
# 20001226 Smitty created.
# -----------------------------------------------------------------------
use POSIX;
use Math::Trig;

$lat{"Appleton"}=44.25;
$lat{"Atlanta"}=33.65;
$lat{"Chicago"}=41.78;
$lat{"Honolulu"}=21.33;
$lat{"Madison"}=43.13;
$lat{"Miami"}=25.8;
$lat{"San Antonio"}=29.53;

($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
if($datein=shift) {
if ($datein=~/^\d{1,2}$/) { # dd
($yyyy,$mm,$dd)=(1900+$year,$mon+1,$datein);
} elsif($datein=~/^(\d{1,2})(\d{2})$/) { # mmdd
($yyyy,$mm,$dd)=(1900+$year,$1,$2);
} elsif($datein=~/^(\d{2,4})(\d{2})(\d{2})$/) { # [yy]yymmdd
($yyyy,$mm,$dd)=($1,$2,$3);
$yyyy+=2000 if($yyyy<100);
} else {
die("ERROR: invalid date format = $datein\n");
}
} else {
($yyyy,$mm,$dd)=(1900+$year,$mon+1,$mday);
}
$numpat='^\d+\.{0,1}\d*$';
$latitude="Appleton" unless($latitude=shift); # Default.
$latitude=$lat{$latitude} unless($latitude=~/$numpat/);
die("ERROR: Bad latitude\n") unless($latitude=~/$numpat/);
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(
mktime(0, 0, 0, $dd, $mm-1, $yyyy-1900));

# Following equation derived from that of David Toomey.
$p = asin(.39795*cos(.2163108 + 2*atan(.9671396*tan(.00860*($yday-185)))));
$daylight = 24 - (24/pi)*acos(
(sin(0.8333*pi/180) + sin($latitude*pi/180)*sin($p)) /
(cos($latitude*pi/180)*cos($p)));

$hours=int($daylight);
$minutes=int(($daylight-$hours)*60.0);
$seconds=sprintf("%2d",($daylight-$hours)*3600-$minutes*60);
$mm='0'.$mm if(length($mm)<2);
$dd='0'.$dd if(length($dd)<2);
print("yyyymmdd=$yyyy$mm$dd latitude=$latitude daylight=".
"$hours hours, $minutes minutes, $seconds seconds.\n");
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address
Display posts from previous:   
Post new topic   Reply to topic    The C-Brats Forum Index -> General Chat All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
     Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum



Page generation time: 0.0856s (PHP: 87% - SQL: 13%) - SQL queries: 21 - GZIP disabled - Debug on