Description Usage Arguments Details Value Author(s) Examples

Given a vector of x-values and a parameter set defining a conic section, produce an array of x- and y- values, optionally with noise added, for the specified conic section.

1 | ```
createConic(x, param, conicType, ranFun = NULL, noise = 1, seedit = NULL, tol = 1e-06)
``` |

`x` |
Vector of (real) values |

`param` |
Either a 6-value set representing the standard quadratic form Ax^2 + Bxy + Cy^2 +Dx + Ey +F = 0 or a 5-value set representing the "hvab,theta" form ((x-h)cosA +(y-v)sinA)^2/a^2 + ((x-h)sinA-(y-v)cosA)^2/b^2 = 1 . In the latter case the value |

`conicType` |
Either the character "e" for ellipse or "h" for hyperbola. Only required if the "hvab,theta" form is used in |

`ranFun` |
If random noise is to be added to the calculated y-values, provide a vectorized function which takes a single input (x). See Details. |

`noise` |
Optional argument to multiply the output of |

`seedit` |
Optional argument to set a starting seed for |

`tol` |
A (small) value used to decide whether various parameter terms are so small that they should be zero. This is used to facilitate distinguishing, e.g., parabolas from hyperbolas. |

When supplied `ranFun`

is used as follows.
y <- y + ranFun(y)*noise . Make sure any function supplied fits that form (no other input argument required; only a vector returned).

An N x 2 array of the x,y pairs. Warning: since there are often two possible y-values for a given x-value (these being quadratic equations), the array does contain duplicate x-values. This may "annoy" some other packages' functions which don't allow that sort of repeated value. If this presents a problem, I'd recommend applying a very small amount of noise to the x-values in this output.

Carl Witthoft <carl@witthoft.com>

1 2 3 4 5 6 7 |

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.