# Load NW Atlantic data and convert to class bathy
data(nw.atlantic)
atl <- as.bathy(nw.atlantic)
# Create vectors of latitude and longitude
lon <- c(-70, -65, -63, -55, -48)
lat <- c(33, 35, 40, 37, 33)
# Compute distances between each point and the -200m isobath
d <- dist2isobath(atl, lon, lat, isobath = -200)
d
# Create a nice palette of bleus for the bathymetry
blues <- c("lightsteelblue4","lightsteelblue3","lightsteelblue2","lightsteelblue1")
# Visualize the great circle distances
plot(atl, image=TRUE, lwd=0.1, land=TRUE,
bpal = list(c(0,max(atl),"grey"), c(min(atl),0,blues)))
points(lon,lat, pch=21, col="orange4", bg="orange2", cex=.8)
linesGC(d[2:3],d[4:5])
# Load aleutians data and plot the map
data(aleutians)
plot(aleutians, image=TRUE, lwd=0.1, land=TRUE,
bpal = list(c(0,max(aleutians),"grey"), c(min(aleutians),0,blues)))
# define start and end points
start <- matrix(c(170,55, 190, 60), ncol=2, byrow=TRUE, dimnames=list(1:2, c("lon","lat")))
end <- matrix(c(200, 56, 201, 57), ncol=2, byrow=TRUE, dimnames=list(1:2, c("lon","lat")))
start
end
# Add points and great circle distances on the map
points(start, pch=21, col="orange4", bg="orange2", cex=.8)
points(end, pch=21, col="orange4", bg="orange2", cex=.8)
linesGC(start, end, antimeridian=TRUE)
Run the code above in your browser using DataLab