Questions tagged [quadratic]

Pertains to squares or squaring. Use this tag for questions relating to quadratic equations, quadratic regression, and similar concepts in the context of programming as defined in the Help Center. It may also be used for questions regarding quadratic probing and quadratic time complexity.

Quadratic means to the second (2nd) power, that means, squares (in algebra), or squaring. This tag is used for questions relating to quadratic equations, regression, and similar programming contexts involving quadratic polynomials or terms.

A quadratic polynomial is a polynomial of degree 2. All quadratic polynomials of a single variable x is of the form ax^2 + bx + c where the quadratic coefficient a != 0. The graph of a quadratic function is a parabola, with open end up if a > 0, and down if a < 0. All quadratic polynomials have exactly two complex roots, and can have either two, one, or zero real roots. The famous quadratic formula, applicable for all quadratic polynomials ax^2 + bx + c with real or complex coefficients a,b,c , is given by x = (-b ± sqrt(b^2 - 4*a*c)) / (2*a).

Here are the graphs of three quadratic functions with color coding

three quadratics

A quadratic regression is a method of finding a parabola, represented as a quadratic polynomial of best fit in a set of data. The chart below shows an example of finding a parabola extrapolating the known data points.

Source: https://www.varsitytutors.com/hotmath/hotmath_help/topics/quadratic-regression

Quadratic Complexity means complexity of O(n^2). That means, it grows similar to a positive quadratic function ax^2 + bx + c, a > 0 as x grows, precisely, f(x) == O(x^2) if f(x)/x^2 is constant. There are two forms of quadratic complexity: quadratic space and quadratic time, indicating that this program or algorithm asymptotically requires extra memory space or took time equal to the square of the size of the input n respectively. Selection sort is an example of a quadratic time algorithm. Linear or better complexity is also within quadratic complexity.

380 questions
2
votes
1 answer

Quadratic Formula in Isabelle?

I'm looking for a theory file which contains the quadratic formula: and of course it would be helpful to know the name of the lemma too. I've already found this paper: http://www.inf.ed.ac.uk/publications/thesis/online/IM040231.pdf and I can…
IIM
  • 523
  • 3
  • 11
2
votes
4 answers

Get quadratic equation term of a graph in R

I need to find the quadratic equation term of a graph I have plotted in R. When I do this in excel, the term appears in a text box on the chart but I'm unsure how to move this to a cell for subsequent use (to apply to values requiring calibrating)…
Joey
  • 161
  • 2
  • 4
  • 9
2
votes
1 answer

Quadratic Bezier Curve: Calculate x for any given y

I have a quadratic bezier curve represented by the following equation (replaced t with x) where x is between 0-1 var y = p0 * Math.pow(x, 2) + p1 * 2 * x * (1 - x) + p2 * Math.pow((1 - x), 2) I want to pass in a known y value and solve for x along…
koga73
  • 712
  • 6
  • 13
2
votes
0 answers

Quadratic GLM in R with interactions?

So I have a question of utilizing quadratic (second order) predictors with GLMs in R. Basically I have three predictor variables (x, y, z) and a response variable (let's call it ozone). X, Y, and Z are not pquadratic predictors yet so I square them…
Leo Ohyama
  • 725
  • 7
  • 21
2
votes
2 answers

How can I modify my quadratic formula program in C to only calculate the square root once in the entire program?

I'm fairly new to the site and I'm attempting a challenge to improve what I already have here for my quadratic equation program. It functions already the way that I need it to, but I seek to learn how to improve it to the best of my ability without…
Luke
  • 31
  • 4
2
votes
3 answers

Haskell Quadratic solution finder - Error

I am using Haskell in college and one of the exercises I have to do is make a function that gives me the roots of a quadratic equation when I give it its coefficients, using a previous function that tells me how many solutions it has. Here's what I…
Rmp
  • 23
  • 3
2
votes
1 answer

Quadratic Formula in Swift

I tried creating an x value calculator for the quadratic formula. Code: var firstXValueVAR = 1.0 var secondXValueVAR = 1.0 var squaredValueVAR = 1.0 var firstOperationValueVAR = "+" var secondOperationValueVAR = "+" var constantValueVAR = 0.0 var…
Andy Lebowitz
  • 1,353
  • 1
  • 11
  • 21
2
votes
1 answer

Plotting individual confidence intervals for the coefficients in the lmList fit

I'm trying to solve an exercise from Pinheiro and Bates book (Mixed-Effects Models in S and S-PLUS) using R. It uses data Pixel from nlme package. The exercise says: Use lmList to fit a separate quadratic model in day for each Dog. Plot the…
Marija T.
  • 53
  • 7
2
votes
1 answer

Quadratic fitted line doesn't appear in R plot

When I run following script in R, the fitted line doesn't appear in the plot. I want it to appear though. Can you help me? rm(list=ls()) # Surface tension surft <- c(49.1, 51.7, 50.7, 52.0, 53.5, 52.9, 55.1, 59, 62.5, 66.4, 69.0, 73.8) # surface…
user3182395
2
votes
1 answer

Building a circle with quadratic curves in canvas

I am trying to build a near-perfect circle with quadratic curves in canvas. I have this function for setting up points around a circle and connecting them with quadratic curves: function calcPointsCircle(cx, cy, radius, dashLength) { var n =…
2
votes
2 answers

Gnu Octave Quadratic Equation Graphic

I lost two days of trying to do this but with no result. How can I plot the quadratic equation's parabola and roots. Something like this. I just need to be able to see the parabola and that it crosses the abscissa at the write coordinates. Here is…
user3132352
  • 403
  • 1
  • 7
  • 22
2
votes
2 answers

How to Solve Equations in iOS

Is there api's or tools that I can use do something in Xcode like SOLVE(2x = x +7); and I get x = 7? Also more complication stuffs like SOLVE(x^2= +6x -8); and get x = 2 or x = 4 So basically you give an equation with one variable, and it returns…
coolcool1994
  • 3,085
  • 3
  • 32
  • 38
2
votes
1 answer

JavaScript window.alert not working

I recently began learning JavaScript and decided to create a program to factor quadratic functions. The program itself is longer, and takes three users inputs (secondnum,firstnum,thirdnum) representing a,b,c in the standard form ax^2+bx+c. The…
BLK Horizon
  • 291
  • 1
  • 2
  • 7
2
votes
0 answers

Ordered factors: glm() show significant L and Q coefficients, but in opposite direction

I have a glm() model with a couple of predictors. Two of such predictors are ordered factors with three levels. One of these two predictors have significant Linear and Quadratic coefficients, but in opposite directions. Assume, for now, that pred_x…
2
votes
1 answer

Jumping with quadratic equation -JAVA

Motion.java package util; import org.newdawn.slick.Input; public class Motion { static double origin,speed; static double playerX=100,playerY=520, calcY; static boolean jump=false; static int x=0; public static void…
user1953222
  • 90
  • 1
  • 7