Skip to content

Instantly share code, notes, and snippets.

View ppmzhang2's full-sized avatar

ppmzhang2

View GitHub Profile
@ppmzhang2
ppmzhang2 / transform_wgs84_to_nzgd2000.py
Created May 24, 2024 15:09
Converts geographic coordinates from WGS84 to NZGD2000.
"""Converts geographic coordinates from WGS84 to NZGD2000."""
import math
AXIS_SEMI_MAJOR = 6378137.0 # Semi-major axis for GRS 80
AXIS_SEMI_MINOR = 6356752.314245179 # Semi-minor axis for GRS 80
FLATTENING = (AXIS_SEMI_MAJOR -
AXIS_SEMI_MINOR) / AXIS_SEMI_MAJOR # Flattening
# FLATTENING = 1 / 298.257222101 # or use the standard value for GRS 80
E2 = 2 * FLATTENING - FLATTENING**2 # Eccentricity squared
FALSE_EASTING = 1600000
if status is-interactive
# Commands to run in interactive sessions can go here
end
# -----------------------------------------------------------------------------
# alias
# -----------------------------------------------------------------------------
function l -d "list all files"
ls -alrth $argv
end
@ppmzhang2
ppmzhang2 / .vimrc
Created February 8, 2023 03:29
Very concise vim configuration
" =============================================================================
"
" Sections:
" -> vim_plug
" -> general
" -> user_interface
" -> colors_and_fonts
" -> misc
"
" =============================================================================