new_isosceles: Add one or more isosceles triangle shapes

View source: R/new_triangles.R View source: R/new_triangle.R

new_isoscelesR Documentation

Add one or more isosceles triangle shapes

Description

isosceles 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.

An isosceles triangles shapes is one or more isosceles triangles defined using the same subset of locating parameters (x, y, px, py, b, h, e, be, ee, au, re, and te). Isosceles triangles are located in plotting regions using bounding rectangles, a concept used in defining function arguments. See the defining bounding rectangles section for details.

Usage

new_isosceles(
  pj,
  x,
  y,
  b = NA,
  h = NA,
  e = NA,
  re = NA,
  te = NA,
  eb = NA,
  ee = NA,
  loc = "b",
  px = 0.5,
  py = 0.5,
  au = "r",
  region = ".",
  look = NULL,
  mod = NULL,
  name = "."
)

new_isosceles(
  pj,
  x,
  y,
  b = NA,
  h = NA,
  e = NA,
  re = NA,
  te = NA,
  eb = NA,
  ee = NA,
  loc = "b",
  px = 0.5,
  py = 0.5,
  au = "r",
  region = ".",
  look = NULL,
  mod = NULL,
  name = "."
)

Arguments

pj

an object of class 'pj'.

x

numeric vector giving horizontal location. When x is used in conjunction with px and w these vectors define a fixed horizontal point for each shape. When x is used in conjunction with re, x defines the left edge of the bounding rectangle of each shape.

y

numeric vector giving vertical location. When y is used in conjunction with py and h these vectors define a fixed vertical point for each shape. When y is used in conjunction with te,y defines the bottom edge of the bounding rectangle of each shape.

b

NA or a positive numeric vector indicating base edge lengths.

h

NA or a numeric vector defining the height of each bounding rectangle.

e

NA or a positive numeric vector indicating non-base edge lengths.

re

NA or a numeric vector defining the right edge of each bounding rectangle.

te

NA or a numeric vector defining the top edge of each bounding rectangle.

ee

NA or a positive numeric vector indicating the angles between the two same-length non-base edges.

loc

character vector indicating where the base of the isosceles triangles are located. 'l', 'r', 'b', and 't' indicate left, right, bottom, and top edges of the bounding rectangle, respectively.

px

NA or a proportion vector defining the location of x as the proportion of the distance from left to right edge of bounding rectangles. Values are generally between 0 and 1, inclusive, however, when they are outside those values, fixed points x will lie outside bounding rectangles.

py

NA or a proportion vector defining the location of y as the proportion of the distance from bottom to top edge of bounding rectangles. Values are generally between 0 and 1, inclusive, however, when they are outside those values, fixed points y will lie outside bounding rectangles.

au

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

region

either character scalar "." to indicate the most recently used region, a positive integer to indicate the ID number of a region (0 indicates the background region), or a character scalar to indicate the name of a region ('bg' indicates the background region).

look

an optional list containing up to four lists specifying looks to apply to the shape. See the using look to make shapes appear section.

mod

an optional list containing up to four lists specifying modifications to apply to the shape. See the using mod to transform shapes section.

name

character scalar indicating a name for the shape. The special value "." indicates that the pj package create a default name for the shape.

s

(optional) positive numeric vector indicating non-base side lengths.

sb, ss

(optional) positive numeric vector indicating, respectively, the angles between (non-base side) and base side vs. angles between the two equal-length non-base sides.

be

NA or a positive numeric vector indicating the angles between (non-base) edges and base edge.

Value

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

pj with the addition of the defined isosceles-triangles.

The h and s arguments

h) is calculated as the perpendicular distance from the vertex between non-base sides to the base side. s is defined as the length of the two equivalent-length non-base sides.

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) + b + (y + py) + h

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

(x + px) + b + (y + px) + s

(x-anchor) + base length + (y-anchor) + side length

(x + px) + b + (y + px) + sb

(x-anchor) + base length + (y-anchor) + base/side angle

(x + px) + b + (y + px) + ss

(x-anchor) + base length + (y-anchor) + side-side angle

(x + px) + b + y + y2

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

x + x2 + (y + py) + h

left + right + (y-anchor) + height

x + x2 + y + y2

left + right + bottom + top

Argument recycling

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

The argument set {x, y, b, h, e, re, te, be, ee, au, px, py, loc} is recycled.

The h and s arguments

h) is calculated as the perpendicular distance from the vertex between non-base sides to the base side. s is defined as the length of the two equivalent-length non-base sides.

Defining bounding rectangles

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

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

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

(x + px) + b + (y + px) + s

(x-anchor) + base + (y-anchor) + side length

(x + px) + b + (y + px) + sb

(x-anchor) + base + (y-anchor) + base/side angle

(x + px) + b + (y + px) + ss

(x-anchor) + base + (y-anchor) + side-side angle

(x + px) + b + y + te

(x-anchor) + base + bottom + top

x + re + (y + py) + h

left + right + (y-anchor) + height

x + re + y + te

left + right + bottom + top

See Also

Other new_shape: new_pvtri(), new_right()

Other new_triangle: new_pvtri(), new_right()

Other new_triangles: new_rights(), new_triangles()


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