plotcurve: Collects and plots the quadratic curve for upper and lower

Description Usage Examples

View source: R/plotcurve.R

Description

Collects and plots the quadratic curve for upper and lower surfaces of the lens.

Usage

1

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--	or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function () 
{
    gridit <- locator()
    points(gridit, pch = 16, col = "red")
    X <- cbind(gridit$x, gridit$x^2)
    m1 <- lm(gridit$y ~ X)
    xpred <- seq(from = 1, to = 2, length = 500)
    xpredM <- cbind(rep(1, 500), xpred, xpred^2)
    ypred <- xpredM %*% coef(m1)
    lines(xpred, ypred, col = "red", lwd = 1, lty = 3)
    return(list(model = m1, data = data.frame(xpred = xpred, 
        ypred = ypred)))
  }

phewson/PhilsAngle documentation built on May 25, 2019, 2:54 a.m.