create_Ellipse: Create Ellipse

View source: R/create_Ellipse.R

create_EllipseR Documentation

Create Ellipse

Description

Create an ellipse.

Usage

create_Ellipse(
  Latc,
  Lonc,
  Lmaj,
  Lmin,
  Ang = 0,
  Np = 100,
  dir = "cw",
  yx = FALSE
)

Arguments

Latc

numeric, latitude of the ellipse centre in decimal degrees, or Y projected coordinate if yx is set to TRUE.

Lonc

numeric, longitude of the ellipse centre in decimal degrees, or X projected coordinate if yx is set to TRUE.

Lmaj

numeric, length of major axis.

Lmin

numeric, length of minor axis.

Ang

numeric, angle of rotation (0-360).

Np

integer, number of points on the ellipse.

dir

character, either "cw" (clockwise) or "ccw" (counterclockwise). Sets the order of points, only matters for create_CircularArrow.

yx

Logical, if set to TRUE the input coordinates are projected. Give Y as Latc and X as Lonc.

Value

Spatial object in your environment.

See Also

create_Arrow, create_CircularArrow, create_Polys, add_Legend.

Examples


# For more examples, see:
# https://github.com/ccamlr/CCAMLRGIS#26-create-ellipse

El1=create_Ellipse(Latc=-61,Lonc=-50,Lmaj=500,Lmin=250,Ang=120)
El2=create_Ellipse(Latc=-72,Lonc=-30,Lmaj=500,Lmin=500)
Hash=create_Hashes(El2,spacing=2,width=2)
El3=create_Ellipse(Latc=-68,Lonc=-55,Lmaj=400,Lmin=100,Ang=35)

terra::plot(SmallBathy(),xlim=c(-3e6,0),ylim=c(0,3e6),breaks=Depth_cuts,
            col=Depth_cols,axes=FALSE,box=FALSE,legend=FALSE)
plot(st_geometry(Coast[Coast$ID=='All',]),col='grey',add=TRUE)
plot(st_geometry(El1),col=rgb(0,1,0.5,alpha=0.5),add=TRUE,lwd=2)
plot(st_geometry(El3),col=rgb(0,0.5,0.5,alpha=0.5),add=TRUE,border="orange",lwd=2)
plot(st_geometry(Hash),add=TRUE,col="red",border=NA)


CCAMLRGIS documentation built on Oct. 15, 2024, 9:10 a.m.