Learn R Programming

TCHazaRds (version 1.1.2)

TCProfilePts: Transect points from a origin through a point or with a bearing and to the opposite side.

Description

Transect points from a origin through a point or with a bearing and to the opposite side.

Usage

TCProfilePts(
  TC_line,
  Through_point = NULL,
  bear = NULL,
  length = 200,
  step = 2
)

Value

spatial vector of transect profile points with distances in Km (negative for left hand side)

Arguments

TC_line

origin of the transect

Through_point

a point to pass through

bear

the bearing

length

the length of the transect in Km

step

the spacing of the transect in Km

Examples

Run this code
require(terra)
TCi <- vect(cbind(c(154.1,154),c(-26.1,-26)),"lines",crs="epsg:4283") #track line segment
TCi$PRES <- 950
TCi$RMAX <- 40
TCi$B <- 1.4
TCi$RMAX2 <- 90
TCi$ISO_TIME <- "2022-10-04 20:00:00"
TCi$LON <- geom(TCi)[1,3]
TCi$LAT <- geom(TCi)[1,4]
TCi$STORM_SPD <- perim(TCi)/(3*3600) #m/s
TCi$thetaFm <- 90-returnBearing(TCi)
#Through_point <- isd[isd$OID==isdsi]
pp <- TCProfilePts(TC_line = TCi,Through_point=NULL,bear=TCi$thetaFm+90,length =100,step=10)
plot(pp,"radialdist",type="continuous")
lines(TCi,col=2)

Run the code above in your browser using DataLab