Skip to contents

Works for the segment-class.

Usage

to(object, ...)

to(object) <- value

# S4 method for class 'segment'
to(object, ...)

# S4 method for class 'segment'
to(object) <- value

Arguments

object

An instance of the segment-class.

...

Arguments passed on to the methods of this generic

value

Value with which to replace the original value of the to slot.

Examples

# Create a segment
my_segment <- segment(from = c(0, 0), to = c(1, 1))

# Access the to slot
to(my_segment)
#> [1] 1 1

# Change the to slot
to(my_segment) <- c(4, 4)
to(my_segment)
#> [1] 4 4

# Note that changing this slot also changes the orientation and size of the 
# line
orientation(my_segment)
#> [1] 0.7853982
size(my_segment)
#> [1] 5.656854