R/bang.R

Defines functions `bang`

`bang` <-
function(x1,y1,x2,y2)
  {
    xp = x1*y2-y1*x2
    xp[xp>=0] =  1
    xp[xp<0]  = -1
    jang = x1*x2+y1*y2
    if(jang>1) jang=1
    ang = xp*acos(jang)
    return(ang)
  }

Try the RFOC package in your browser

Any scripts or data that you put into this service are public.

RFOC documentation built on Sept. 8, 2023, 6:12 p.m.