lf_intersect: Intersection point from two linear functions

View source: R/Linear_functions.R

lf_intersectR Documentation

Intersection point from two linear functions

Description

Calculate intersecting point(s) from two linear function x and linear function y.

Usage

lf_intersect(x, ...)

Arguments

x

vector, matrix or data frame with slope and intercept

...

vector with slope and intercept

Details

Get the intersecting point of two linear Functions. If only x is supplied, x needs to be a matrix or data.frame containing both linear functions. If x and or y have names you shall use the names (slope, intercept).

Value

vector

Author(s)

Florian Wagner florian.wagner@wagnius.ch

Examples

x <- c(slope = 0.5, intercept = 1)
y <- c(slope = -1, intercept = 2)
lf_intersect(x,y)
rbind(x,y)|>lf_intersect()
matrix(c(x,y),ncol = 2, byrow = TRUE)|>lf_intersect()
matrix(c(0.2,-1,2,3),ncol = 2)|>lf_intersect()

wagnius-GmbH/slvwagner documentation built on Jan. 19, 2025, 7:10 a.m.