lineval: Draw a line through two said points

View source: R/lineval.R

linevalR Documentation

Draw a line through two said points

Description

Given two points, (x1,y1) and (x2,y2) and a dataset X, the function spills out a vector Y
Y is the sequence of values of the line for the corresponding values of X

Usage

lineval(v1, v2, X)

Arguments

v1, v2

Two element numeric (atomic) vectors

X

Numeric sequence for which Y values are required

Value

The return type is a numeric vector(Y) with the same length as X

Author(s)

Chitran Ghosal

Examples

X <- seq(0, 20, by=0.01)
v1 <- (0,0)
v2 <- (3,4)
Y <- lineval(v1, v2, X)
plot(X, Y)

Chitran1987/StatsChitran documentation built on Feb. 23, 2025, 8:30 p.m.