Nothing
# solves quadratic equation given by y = a + b*x + c*x^2
# Based on MAESTRA equivalent (B. Medlyn)
# - larger root
QUADP <- function(A,B,C){
if((B^2 - 4*A*C) < 0){
warning("IMAGINARY ROOTS IN QUADRATIC")
return(0)
}
if(identical(A,0)){
if(identical(B,0)){
return(0)
} else {
return(-C/B)
}
} else {
return((- B + sqrt(B^2 - 4*A*C)) / (2*A))
}
}
# - smaller root
QUADM <- function(A,B,C){
if((B^2 - 4*A*C) < 0){
warning("IMAGINARY ROOTS IN QUADRATIC")
return(0)
}
if(identical(A,0)){
if(identical(B,0)){
return(0)
} else {
return(-C/B)
}
} else {
return((- B - sqrt(B^2 - 4*A*C)) / (2*A))
}
}
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.