quadratic

Using Scheme code to solve a quadratic equation?

I wrote this scheme code to compute one solution of the quadratic equation a*x2 + b*x + c = 0 (define (solve-quadratic-equation a b c) (define disc (sqrt (- (* b b) (* 4.0 a c)))) (/ (+ (- b) disc) (* 2.0 a))) However, someone told me that this procedure is hard to understand. Why? What would a cleaned up version of this procedure lo...

Fast Method to Intersect two Integer Quadratic Beziers?

Given two Quadratic Beziers in 2D with integer coordinates, what is the best way to find their intersection point(s)? Also interesting is an early rejection if they do not intersect. If it makes it easier, they can both be assumed to be monotone in both x and y. Only intersections that are representable by subdivision to integers of the ...

Convert a quadratic curve points to polynomial representation?

I have the X,Y of 2 end points and 1 bezier point, of a Quadratic Bezier curve. Using this data, how can I derive the polynomial representation of the curve? ...

Solve Quadratic Equation in C++

Hello all, I am trying to write a function in C++ that solves for X using the quadratic equation. This is what I have written initially, which seems to work as long as there are no complex numbers for an answer: float solution1 = (float)(-1.0 * b) + (sqrt((b * b) - (4 * a * c))); solution1 = solution1 / (2*a); cout << "Solution 1: " <...

QP solver for Java

I'm looking for a good easy to use Java based Quadratic Programming (QP) solver. Googling around I came across ojAlgo (http://ojalgo.org). However, I was wondering if there are any other/better alternatives. ...

Haskell and Quadratics

Hi, I have to write a program to solve quadratics, returning a complex number result. I've gotten so far, with defining a complex number, declaring it to be part of num, so +,- and * - ing can take place. I've also defined a data type for a quadratic equation, but im now stuck with the actual solving of the quadratic. My math is quite...

C# Draw Quadratic Curve

How can I draw Quadratic Curve through 3 points by using C# System.Drawing namespace? ...

Is it possible to exclude hidden rows when searching for duplicates in Excel?

I am working on a procedure in Excel using VBA that highlights duplicate rows. The procedure evaluates the result of the worksheet function sumproduct to determine if the row has duplicates. The evaluated formula ends up looking like this: SUMPRODUCT(--(A1:A10 = A1), --(B1:B10 = B1), --(C1:C10 = C1)) So far the procedure works great,...

Smoothing Small Data Set With Second Order Quadratic Curve

I'm doing some specific signal analysis, and I am in need of a method that would smooth out a given bell-shaped distribution curve. A running average approach isn't producing the results I desire. I want to keep the min/max, and general shape of my fitted curve intact, but resolve the inconsistencies in sampling. In short: if given a se...

The most efficient method of drawing multiple quads in OpenGL

I'm not very keen with OpenGL and I was wondering if someone could give me some insight on this. I'm a 'seasoned' programmer, I've read the redbook about VBOs and the like, but I was wondering from a more experienced person about the best/most efficient way of achieving this. I've been producing this 2d tile-based game engine to be used...

Write an overloaded operator+ function so that two instances of the quadratic class can be added together as in the following code:

Write an overloaded operator+ function so that two instances of the quadratic class can be added together as in the following code: quadratic y1 = quadratic (1.0, -5.0, 7.0); quadratic y2 = quadratic (-3.0, -2.0, 10.0); quadratic y3; double result; y3 = y1 + y2; result = y1.evaluate (10.0); cout << result <<endl; To help you out, her...

Does this method work for solving the quadratic equation using JavaScript?

I'm trying to do some "complex" math where I need to call upon some of JavaScript's Math properties to solve the quadratic equation. Does the following method work? root = Math.pow(inputb,2) - 4 * inputa * inputc; root1 = (-inputb + Math.sqrt(root))/2*inputa; root2 = (-inputb - Math.sqrt(root))/2*inputa; Does this look co...

ASP.NET quadratic calculation returning NaN erroneously

My ASP.NET MVC web application is supposed to calculate the roots of a second-degree polynomial (quadratic) but I'm erroneously getting Nan responses. I believe this is due to my improper setup, so let me post some of my code here: View: <%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.M...