Questions tagged [cubic]

Pertaining to cubing, or being of the third power. In mathematics, it is notated as a superscript three (x³). Use this tag for programming-relevant questions that involves cubic equations and similar concepts, which have applications such as computational complexity, and cubic spline interpolation. This tag is not to be confused with the "cube" tag, which refers to the *OLAP cube*.

Cubic means of degree three. Variables raised to the third variable are called cubes in algebra, and a cubic polynomial is a third-degree polynomial.

Cubic polynomials are polynomials whose highest degree is three. All cubic polynomials of one variable are of the form A*x^3 + B*x^2 + C*x + D where leading coefficient A is nonzero. The graph of a cubic function rises for positive A, and falls for negative A, but it is described as "bendy" and that it has an inflection point.

All cubic polynomials have three complex roots, where one to three of the roots are real. Therefore, all cubic polynomials may be factored as (x-p)*(x-q)*(x-r) where p, q, r are complex and potentially real roots. All three complex roots of every cubic polynomial can be solved in terms of radicals, this is known as the Cardano formula.

The first derivative of a cubic polynomial is a quadratic polynomial, which is 3*A*x^2 + 2*B*x + C

Here are the graphs of five cubic polynomials.

enter image description here

Cubic Spline Interpolation is a process where a shape or curve is approximated or interpolated by piecewise cubic functions. This is useful for extrapolating sets of points or data with a smooth curve, as well as approximating shapes and fonts.

Here is an example of a cubic spline interpolating a series of five points.

Source: http://mathworld.wolfram.com/CubicSpline.html

Cubic Complexity means having an asymptotic complexity of O(x^3). That means, it grows similar to a positive cubic function A*x^3 + B*x^2 + C*x + D as x grows, or in calculus terms, f(x) == O(x^3) if the limit as x grows to positive infinity, f(x)/x^3 is a constant.

There are two forms of cubic complexity: cubic space and cubic time, indicating that this program or algorithm asymptotically requires extra memory space or took time equal or less than the cube of the size of the input n respectively. It is worse than quadratic complexity, but it is still considered efficient as it is in polynomial complexity. Matrix multiplication between m×k and k×n matrices is a cubic-time algorithm of time O(m*k*n), whereas the best square matrix multiplication can be done faster than cubic time but still slower than quadratic time; matrix multiplication is therefore a cubic time algorithm.

Related tags

  • : Generalization of 'cubic' and 'quadratic' by having any (constant) degree.

  • , : Tags referring to lower polynomial times

  • , , : Tags relating to complexity, including the famous polynomial time such as linear time, quadratic time, and cubic time.

  • : Applications of cubic polynomials where a curve or point set is approximated by piecewise cubic polynomials.

  • : Do not confuse between "cubic" and "cube" tags. Here, the "cube" tag refers to the OLAP cube datastructure.

Read More:

103 questions
0
votes
0 answers

Solving Cubic Formula Java

I'm trying to create a program where when you insert inputs for the variables, it will solve for the roots. This is what I currently have: import javax.swing.JOptionPane; public class perfTaskTest { public static void main(String[]args) { …
0
votes
1 answer

how can I make a larger array with cubic interpolation and acces all the calculated values?

I am trying to get a cubic interpolation of a data set, e.g y = [0, 100, 200, 300, 400] and x = [0, 28, 54, 78, 100]. With the linear interpolation from the numpy library everything just works fine but I need a smooth data set. In the code sample…
0
votes
1 answer

Cubic interpolation for specific points using interp2 in Matlab

Given the following example is there a way to achieve bicubic interpolation without generating an entire finely-spaced grid?: years = [5,10,20,25,40]; service = 1:3; wage = [50 99 787.685 779 795 850 803 779 388 …
Mary
  • 788
  • 6
  • 19
  • 43
0
votes
1 answer

Placement of Math.toRadians for solving quadratic and cubic equations

I am writing a program which solves either quadratic or cubic equations. The thing is that I don't know if I am placing the Math.toRadians correctly. The code is the following: public double[] getRaices(double a,double b, double c, double d) throws…
0
votes
1 answer

Negative scale on SVG Bezier curve not working

Im trying to make a logo in SVG, and for that purpose, I need to do mirroring. Im using negative scale transformation on my path, but when I do it simply disappear ... \
0
votes
0 answers

Python, decimal figures, complex numbers

I am currently writing a program to determine the roots of a cubic equation. This is what I have written so far: import math def sols(a, b, c, d ): disc = 18*a*b*c*d - 4*(b**3)*d + (b**2)*(c**2) - 4*a*(c**3) - 27*(a**2)*(d**2) x = b**2.0 -…
Heav
  • 1
0
votes
1 answer

CSS flying and enlarge logo on curved path

I have to make an animation with css. A logo flying and enlarging into the front based on a curved path or parabola. I made a small sketch. The logo is staring small top right, flying and getting larger and is ending left center. Sketch I found a…
0
votes
1 answer

Smooth Interpolation between two points

i am trying to interpolate in a mesh between points. I did some research and found few solutions, but all of them produce weird results for me. I tried Cosinus and Cubic interpolation, but whole mesh gets tiny waves in it instead of being smooth. I…
CosmicSeizure
  • 1,375
  • 5
  • 17
  • 35
0
votes
1 answer

How to make a pen tools which the curve go smoothly using beizer function

I have a problem of writing the beizer function. I have written a simple code in c# : public static PointF[] BeizerFunction (int interval, PointF point0, PointF point1, PointF point2) { //x = (1 - t) * (1 - t) * p[0].x + 2 * (1 - t) * t *…
LittleFunny
  • 8,155
  • 15
  • 87
  • 198
0
votes
0 answers

Maths - How to plot a course to a point with constrained final velocity?

First of all a disclaimer: I'm posting this question here even if I realize it is quite maths heavy, because I have trouble figuring out on what other site it could belong. I'm writing a 2d spaceships game where the player will have to select the…
Marco Bolis
  • 1,222
  • 2
  • 15
  • 31
0
votes
1 answer

Matlab: plot Cubic function for range of y values

I have a cubic equation: roots([9E-10 -2E-06 0.0014 0.039]) I am trying to plot the equation for y values of 0.0 to 0.5 (which I know gives x values in the range of 0 to 700. (i.e. the equation has been fit to this data) r=0.0039-y; %where y ranges…
2one
  • 1,035
  • 3
  • 17
  • 36
0
votes
0 answers

Approximate raster image based on Cubic Bezier

I am unable to wrap my head around this problem. I have a Cubic Bezier spline on screen, my goal is to have it built with "big pixels". Here's the picture to show what I am talking about:
0
votes
1 answer

Change Number of Portfolio Items on Homepage Wordpress Cubic Theme

I really would like to change the number of portfolio items (Onze Projecten) on the homepage of http://www.bodifee.com from 6 to 9 or even 12. I build the homepage with visual composer and the portfolio items are created by using the element OT Our…
k-Dushi
  • 23
  • 6
0
votes
1 answer

Cubic Fit to Graph. How Do I create a better fit to my data and retrieve values from the fit?

I have plotted some experimental data in Python and need to find a cubic fit to the data. The reason I need to do this is because the cubic fit will be used to remove background (in this case resistance in a diode) and you will be left with the…
0
votes
3 answers

Get x on Bezier curve given y

I have a Bezier curve: (0,0), (.25,.1), (.25,1), and (1,1). This is graphically seen here: http://cubic-bezier.com/#.25,.1,.25,1 We see on the x axis is time. This is my unknown. This is a unit cell. So I was wondering how can I get x when y is…
Noitidart
  • 35,443
  • 37
  • 154
  • 323