vector3_arith | R Documentation |
Addition or subtraction requires two 'vector3' of equal length or length 1. In the case one vector is length 1, it is broadcast across the other value.
## S3 method for class 'dddr_vector3' vec_arith(op, x, y, ...) ## Default S3 method: vec_arith.dddr_vector3(op, x, y, ...) ## S3 method for class 'dddr_vector3' vec_arith.dddr_vector3(op, x, y, ...) ## S3 method for class 'numeric' vec_arith.dddr_vector3(op, x, y, ...) ## S3 method for class 'MISSING' vec_arith.dddr_vector3(op, x, y, ...) ## S3 method for class 'dddr_vector3' vec_arith.numeric(op, x, y, ...)
op |
Arithmetic operation, i.e, '"+"', '"-"', '"*"', or '"/"' |
x, y |
Operands |
... |
Unused; present for extensibility |
For multiplication or division, numeric vectors can be length 1, which is broadcast across all entries, or can be the same length as the vector3 vector, where each element is scaled individually.
vector3_math
vector3(x = 1:4, y = 2:5, z = 3:6) + vector3(x = 4:7, y = 5:8, z = 6:9) vector3(x = 1:4, y = 2:5, z = 3:6) - vector3(2, 0, -1) vector3(x = 1:4, y = 2:5, z = 3:6) * 4 vector3(x = 1:4, y = 2:5, z = 3:6) / c(3, 1, 4, 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.