Notities

powershell

Powershell script om alle subdirectories af te gaan, een patroon te vinden en vervolgens te tonen:

Select-String .\*\*.kap -pattern PLY | Format-List -Property Line,Filename -GroupBy Filename

---
powershell script to sort files (bing maps, google maps, based on quad key)

\$source

= "c:\folder1\*.png"
\$target_dir = "c:\folder2"
if (!(\$target_dir.endswith("\"))){\$target_dir += "\"}
\$files = gci \$source
foreach (\$file in \$files)

\$subfolder = \$file.name.length-4

if (!(test-path (\$target_dir + \$subfolder)))
{

mkdir (\$target_dir + \$subfolder)
}

\$newfile = \$target_dir + \$subfolder + "\" + \$file.name

move-item \$file.fullname \$newfile
#add-content log.txt "Moved \$(\$file.fullname) to \$(\$newfile)"
}

other

Destination point given distance and bearing from start point

Given a start point, initial bearing, and distance, this will calculate the destination point and final bearing travelling along a (shortest distance) great circle arc.

 Formula: lat2 = asin(sin(lat1)*cos(d/R) + cos(lat1)*sin(d/R)*cos(θ)) lon2 = lon1 + atan2(sin(θ)*sin(d/R)*cos(lat1), cos(d/R)−sin(lat1)*sin(lat2)) d/R is the angular distance (in radians), where d is the distance travelled and R is the earth’s radius JavaScript: ```var lat2 = Math.asin( Math.sin(lat1)*Math.cos(d/R) + Math.cos(lat1)*Math.sin(d/R)*Math.cos(brng) ); var lon2 = lon1 + Math.atan2(Math.sin(brng)*Math.sin(d/R)*Math.cos(lat1), Math.cos(d/R)-Math.sin(lat1)*Math.sin(lat2));``` Excel: lat2: =ASIN(SIN(lat1)*COS(d/R) + COS(lat1)*SIN(d/R)*COS(brng))lon2: =lon1 + ATAN2(COS(d/R)-SIN(lat1)*SIN(lat2), SIN(brng)*SIN(d/R)*COS(lat1))

For final bearing, simply take the initial bearing from the end point to the start point and reverse it (using θ = (θ+180) % 360).

NMEA XDR

\$IIXDR,U,12.8,V,VAH30*04 (Voltage)
\$IIXDR,G,0299,,VAH30*57 (Remaining Amp Hours)
\$IIXDR,I,-002,A,VAH30*05 (Current)

U = Voltage
G = Remaining Amps hours
I = Current
A = Angle? (description field used as HDC, PIT, ROL (heading, pitch, roll) in nexus)

So it seems there is one letter for each meaning