Andy

Building Shadow Analysis Program

Earlier this week I wrote a small PHP script for analysis of the shadow cast by buildings on the surrounding landscape. To obtain sun position and altitude, it relies on SunCalc PHP which must be included in the script. It goes throughout the year, churning out how much of a shadow a building will produce each hour, in feet and direction. Additionally, the script will calculate the maximum point the shadow will be cast as a set of coordinates.

<?php
// The current values entered into this script currently are for the Empire Plaza.
$latitude = 42.64915;
$longitude = -73.75950;
$height = 610;

$start = strtotime("January 1, 2020 12 AM");
$end = strtotime("December 31, 2020 11 PM");

include("suncalc.php");

// Compass as a Reference
$compass = array(
'north', 'north-northeast', 'northeast',
'east-northeast', 'east', 'east-southeast',
'southeast', 'south-southeast', 'south',
'south-southwest', 'southwest',
'west-southwest', 'west', 'west-northwest',
'northwest', 'north-northwest');

function newPos($lat, $lng, $dist, $dir) {
// Earth Radius in KM
$R = 6378.14;

// distance in feet to KM
$d = (($dist * 0.3048) / 1000);

// Degree to Radian
$lat1 = $lat * (M_PI/180);
$lng1 = $lng * (M_PI/180);
$brng = $dir * (M_PI/180);

// Really Complicated Math (TM) that works based on the HAVERSINE formula from
// https://stackoverflow.com/questions/7222382/get-lat-long-given-current-point-distance-and-bearing
$lat2 = asin(sin($lat1)*cos($d/$R) + cos($lat1)*sin($d/$R)*cos($brng));
$lng2 = $lng1 + atan2(sin($brng)*sin($d/$R)*cos($lat1),cos($d/$R)-sin($lat1)*sin($lat2));

# back to degrees
$lat2 = $lat2 * (180/M_PI);
$lng2 = $lng2 * (180/M_PI);

return "$lat2,$lng2";
}

$output = "Month,Day,Hour,Sun Angle,Sun Position,Sun Pos Name,Shadow Length,Shadow Direction,Shadow Dir Name,Orginal Lat, Original Lng, Maximum Shadow Lat, Maximum Shadow Lng\n";
for ($time = $start; $time &amp;lt; $end; $time += 60*60) { // get sun position for time $timeObj = new DateTime(); $timeObj-&amp;gt;setTimestamp($time);

$sc = new AurorasLive\SunCalc($timeObj, $latitude, $longitude);
$sunPos = $sc-&amp;gt;getSunPosition($timeObj);

// don't include any time when sun is below the horizon
if ($sunPos-&amp;gt;altitude*(180/M_PI) &amp;lt; 0) continue; // add month, day, hour $output .= date('n,j,G,',$time); // get sun altitude $output .= $sunPos-&amp;gt;altitude*(180/M_PI).',';

// get sun position
$output .= 180+$sunPos-&amp;gt;azimuth*(180/M_PI).',';
$output .= $compass[round((180+$sunPos-&amp;gt;azimuth*(180/M_PI))/ 22.5) % 16].',';

// shadow length
$output .= $height/tan(deg2rad($sunPos-&amp;gt;altitude*(180/M_PI))).',';

// shadow direction
$shadowDir = $sunPos-&amp;gt;azimuth*(180/M_PI) + 360;
if ($shadowDir &amp;gt; 360) $shadowDir -= 360;

$output .= $shadowDir.',';
$output .= $compass[round($shadowDir/ 22.5) % 16].',';

// building latitude and longitude
$output .= "$latitude, $longitude,";

// maximum extent of shadow
$output .= newPos($latitude, $longitude, $height/tan(deg2rad($sunPos-&amp;gt;altitude*(180/M_PI))), $shadowDir).",";

$output .= "\n";
}

echo $output;

Here is an example output:

Month,Day,Hour,Sun Angle,Sun Position,Sun Pos Name,Shadow Length,Shadow Direction,Shadow Dir Name,Orginal Lat, Original Lng, Maximum Shadow Lat, Maximum Shadow Lng
1,1,8,4.370562595888,127.16997476055,southeast,7981.2630997694,307.16997476055,northwest,42.64915, -73.7595,42.662350867593,-73.783180446551,
1,1,9,12.464234785715,138.47001937172,southeast,2759.6833421566,318.47001937172,northwest,42.64915, -73.7595,42.654806428356,-73.766311948646,
1,1,10,18.826346377511,151.18871989968,south-southeast,1789.1660233981,331.18871989968,north-northwest,42.64915, -73.7595,42.653442385927,-73.762710054908,
1,1,11,22.92597731207,165.29270254371,south-southeast,1442.2476816852,345.29270254371,north-northwest,42.64915, -73.7595,42.652969571748,-73.76086316453,
1,1,12,24.317973645092,180.27827074558,south,1349.8710413416,0.27827074557518,north,42.64915, -73.7595,42.652845989302,-73.7594755931,
1,1,13,22.827705402895,195.24737437252,south-southwest,1449.1706789769,15.247374372522,north-northeast,42.64915, -73.7595,42.652978239559,-73.758081165062,
1,1,14,18.641667869753,209.31025239405,south-southwest,1808.2272087538,29.310252394054,north-northeast,42.64915, -73.7595,42.653467170112,-73.756204500047,
1,1,15,12.211118961179,221.98033545934,southwest,2818.7133569306,41.980335459338,northeast,42.64915, -73.7595,42.654887013398,-73.752480800429,
1,1,16,4.0670753820534,233.23837174035,southwest,8579.0650125467,53.238371740354,northeast,42.64915, -73.7595,42.663205632648,-73.733908619093,
1,2,8,4.3645441749857,127.03353849744,southeast,7992.3115188513,307.03353849744,northwest,42.64915, -73.7595,42.662327567958,-73.783255965565,
1,2,9,12.476443037614,138.33095911417,southeast,2756.8958218911,318.33095911417,northwest,42.64915, -73.7595,42.654788550435,-73.766323694576,
1,2,10,18.860737296743,151.04916237459,south-southeast,1785.6561891219,331.04916237459,north-northwest,42.64915, -73.7595,42.653428213262,-73.762717935368,
1,2,11,22.985140372821,165.15894624042,south-southeast,1438.1068136859,345.15894624042,north-northwest,42.64915, -73.7595,42.652956261035,-73.760871335783,
1,2,12,24.401639825801,180.15947237405,south,1344.6352402431,0.15947237405339,north,42.64915, -73.7595,42.652831682677,-73.759486067027,
1,2,13,22.932215921968,195.15131682951,south-southwest,1441.810083379,15.151316829514,north-northeast,42.64915, -73.7595,42.652960530629,-73.7580970562,
1,2,14,18.761308368827,209.23956034287,south-southwest,1795.8375075952,29.239560342872,north-northeast,42.64915, -73.7595,42.653440556697,-73.756234277101,
1,2,15,12.340240887742,221.93268535805,southwest,2788.302504508,41.932685358049,northeast,42.64915, -73.7595,42.654829364851,-73.752562956502,
1,2,16,4.2013827926665,233.20922777897,southwest,8303.8756666826,53.209227778967,northeast,42.64915, -73.7595,42.662764126188,-73.734739101558,

Egg Highlighted

East Branch Sacandaga Camping, Hiking, Hunting and Fishing Opporunties

The East Branch Sacandaga River, stretching between Wevertown and Wells along NY 8, offers a rugged yet accessible Adirondack experience with a mix of roadside convenience and remote wilderness. This corridor is a popular destination for its “first-come, first-served” primitive camping, diverse trout fishing, and scenic hiking trails that lead to hidden waterfalls and quiet ponds.Β 

Roadside Camping along NY 8

The New York Department of Environmental Conservation (DEC) maintains approximately 15 designated primitive roadside campsites along NY 8. These sites are free to use but lack amenities like running water or electricity. 

  • Designated Sites: Campsites are marked with a yellow “Camp Here” disc. Notable locations include:
    • Sites 1-4: Located near the Kibby Pond area; Site 2 overlooks a cliff, and Site 4 is perched above Kibby Brook.
    • Sites 7 & 8: Situated near the Cod Pond parking area.
    • Site 10: A gravel pit site located about 1/4 mile south of the Girrad Sugarbush Trailhead.
  • Accessibility: Most sites are accessible by car, though some may require shoveling in winter or can be muddy in early spring.
  • Developed Alternative: For those seeking amenities like hot showers and flush toilets, the Sacandaga Campground is located at the confluence of the East and West branches in Wells.Β 

Hiking & Waterfalls

Trails along the East Branch range from short walks to more challenging treks into the Siamese Ponds Wilderness.Β 

  • Auger Falls Loop: A short, 0.9-mile easy loop leading to a 70-foot drop in the river.
  • Shanty Brook Trail: A moderate 1.3-mile hike that requires wading across the East Branch to reach a remote waterfall; do not attempt during high spring runoff.
  • Cod Pond Trail: An easy walk to a quiet pond with a designated backcountry campsite at the end of the trail.
  • Stewart Creek: Offers scenic views of waterfalls, a flume, and the ruins of the historic Fox Lair Camp.Β 

Fishing & Hunting

The river is a productive trout fishery, with varying regulations depending on the specific reach. 

  • Fishing:
    • Species: The river is stocked with brown trout, while the upper sections and smaller tributaries like Kibby Brook hold wild brook trout.
    • Regulations: General trout season runs from April 1 to October 15, with a catch-and-release season using artificial lures from October 16 to March 31.
    • Access: Many roadside pull-offs along NY 8 provide direct access to deep pools and pocket water.
  • Hunting:
    • The surrounding Siamese Ponds Wilderness and Wilcox Lake Wild Forest are open for big game (deer, bear) and small game (grouse, hare) hunting during state-regulated seasons.

Other Activities

  • Paddling: During the spring snowmelt or after heavy rains, the river provides “white water” opportunities for experienced kayakers and canoeists.
  • Scenic Driving: The stretch of NY 8 between Wevertown and Wells is considered one of the most scenic drives in the southern Adirondacks, passing through the narrow river gorge.Β