Description Usage Arguments Examples
View source: R/port_intersection.R
The wires twist and turn, but the two wires occasionally cross paths. To fix the circuit, you need to find the intersection point closest to the central port. Because the wires are on a grid, use the Manhattan distance for this measurement. While the wires do technically cross right at the central port where they both start, this point does not count, nor does a wire count as crossing with itself.
1 | port_intersection(wire1, wire2, use_time = FALSE)
|
wire1, wire2 |
A character vector of wires |
use_time |
A logical should the answer return time or manhatan distance |
1 2 | port_intersection(day_3[[1]], day_3[[2]])
port_intersection(day_3[[1]], day_3[[2]], use_time = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.