# [Rcpp-devel] Root finder in Rcpp for a quadratic equation in two variables

Scida, Daniela daniela_scida at alumni.brown.edu
Wed Feb 1 22:49:32 CET 2017

```I am new to Rcpp so I apologize in advance if this question is simple to
answer. I searched on the web but couldn't find much help and I am hoping
the savviness in this forum can help me!

I have an existing code in R using Rcpp, and I need to add to this code the
following. I have a quadratic function in two variables, f(x, y), and I
need to find the zeros or roots of it:

f(x, y) = (x + by + c)' W (x + by + c)

where the unknowns are x and y. That is, I am interested in finding the set
of pairs (x, y) that satisfy f(x , y)=0.

*Note:* This is a simulation exercise where I need to find the zeros of
this function for different values of a, b, c and W. Therefore, I need to
code this in a mechanical way (cannot just find the solution, for instance,
by graphical inspection). Both variables are continue, and I don't want to
work with a grid for (x,y) to see when f(x,y)=0. I need a more general
solution. I don't really know what values (x,y) can take.
Thank you,

Daniela.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.r-forge.r-project.org/pipermail/rcpp-devel/attachments/20170201/15c36c42/attachment.html>
```