new_right: Add one or more right triangle shapes

View source: R/new_triangle.R

new_rightR Documentation

Add one or more right triangle shapes

Description

right triangle shapes are located in plotting regions using bounding rectangles; a concept used in defining function parameters. See the locating bounding rectangles section for details.

Usage

new_right(
  jp,
  x,
  y,
  loc = "bl",
  px = 0.5,
  py = 0.5,
  b = NA,
  h = NA,
  hyp = NA,
  hb = NA,
  hh = NA,
  x2 = NA,
  y2 = NA,
  au = NA,
  look = NULL,
  mod = NULL,
  region = ".",
  name = "."
)

Arguments

loc

(required) character vector indicating where the 90-degree angle of the right triangles are located. 'bl', 'br', 'tl', and 'tr' indicate bottom-left, bottom-right, top-left, and top-right corners of the bounding rectangle, respectively.

b

(optional) positive numeric vector indicating base length.

hyp

(optional) positive numeric vector indicating hypotenuse length.

hb, hh

(optional) positive numeric vectors indicating, respectively, the angle between (hb) the hypotenuse and base and (hs) the angle between the hypotenuse and the non-base side.

au

(optional) character vector indicating angle units where 'd', 'g', 'r', and 'p' indicate degrees, gradians, radians, and proportions of a revolution.

Value

jp with the addition of the specified right triangle shape(s).

Locating bounding rectangles

Bounding rectangles can be located in a number of ways. The following shows valid combination of non-NA locating arguments:

(x + px) + (y + py) + b + h

(x anchor) + (y anchor) + base + height

(x + px) + (y + py) + b + hyp

(x anchor) + (y anchor) + base + hypotenuse

(x + px) + (y + py) + h + hyp

(x anchor) + (y anchor) + height + hypotenuse

(x + px) + (y + py) + b + hb

(x anchor) + (y anchor) + base + base/hypotenuse angle

(x + px) + (y + py) + b + hh

(x anchor) + (y anchor) + base + height/hypotenuse angle

(x + px) + (y + py) + h + hb

(x anchor) + (y anchor) + height + base/hypotenuse angle

(x + px) + (y + py) + h + hh

(x anchor) + (y anchor) + height + height/hypotenuse angle

(x + px) + (y + py) + hyp + hb

(x anchor) + (y anchor) + hypotenuse + base/hypotenuse angle

(x + px) + (y + py) + hyp + hh

(x anchor) + (y anchor) + hypotenuse + height/hypotenuse angle

(x + px) + b + y + y2

(x-anchor) + base + bottom edge + top edge

x + x2 + (y + py) + h

left edge + right edge + (y-anchor) + height

x + x2 + y + y2

left edge + right edge + bottom edge + top edge

Argument recycling

Arguments x, y, loc, px, py, b, h, s, ab, as, au, x2, and y2 are recycled.

See Also

Other new_shape: new_isosceles(), new_pvtri()

Other new_triangle: new_isosceles(), new_pvtri()


j-martineau/pj documentation built on March 19, 2022, 5:32 a.m.