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
1
vote
2 answers

Check if Bezier Curve is sub-curve of another Bezier

I want to check if a cubic Bezier curve is a sub-curve of another Bezier. I think I understand basically how to do this, express the Beziers as two cubics, in x and y, then test if the cubics are scalings or translations of each other. If the…
Malcolm McLean
  • 6,258
  • 1
  • 17
  • 18
1
vote
1 answer

Find the root of a cubic function

Here is the thing. I am trying to use fsolve function in Python to find the root of a cubic function. This cubic function has a parameter, deltaW. What I do is change this parameter deltaW from -50 to 50, and find the root of the cubic function…
epx
  • 571
  • 4
  • 16
  • 27
1
vote
3 answers

Opposite of ease cubic-bezier function

I have the ease cubic-bezier function: cubic-bezier(.25,.1,.25,1) (http://cubic-bezier.com/#.25,.1,.25,1) I want the opposite of this. Here is graphic representation of what I'm trying to accomplish: The graph on left is what I have, and the…
Noitidart
  • 35,443
  • 37
  • 154
  • 323
1
vote
1 answer

How to guarantee that a cubic interpolation is monotonic?

In general: Given an arbitrary set of data that is itself monotonic, how should I calculate an additional n points to force a non-monotonic cubic interpolation (which I have to use, no other choice) to be monotonic? Specifically for me: I have a…
AaronD
  • 503
  • 1
  • 7
  • 23
1
vote
4 answers

How to solve cubic equation analytically (exact solution) in R?

I'm trying to get solution of cubic equations analytically in R, not numerically. I looked up on the internet and get the formula for cubic roots and wrote the following code: The link is: http://www.math.vanderbilt.edu/~schectex/courses/cubic/ cub…
ElaineC
  • 41
  • 2
  • 8
1
vote
2 answers

Why does MATLAB piecewise cubic interpolation give diagonalized plot data in 2-D surface plot fits?

Does anyone know why does MATLAB 'piecewise cubic interpolation' gives diagonalized plot data in a 2-D surface plot fit? Attached is a 2-D surface plot (below the code & data) from the code using this cubic fit. As can be seen, peaks in the…
1
vote
2 answers

Equation for Length of Cubic Spline Between 3 Points

This is my first time posting here, so I hope this is ok. I'm working on a java project but my question is really about the math I'll be using for it... I have three (different) points at (x1, y1), (x2, y2), and (x3, y3). All I need is a formula for…
Anthony K.
  • 29
  • 3
1
vote
1 answer

Matplotlib: Data cubic interpolation (or FIT) for Contour plot

I have a series of data from device. How can i make cubic interpolation or FIT for this plot? import matplotlib.pyplot as plt a = [[1,1,1],[2,2,2],[3,3,3]] b = [[1,2,3],[1,2,3],[1,2,3]] c = [[3,2,1],[1,4,2],[4,5,1]] fig1 = plt.figure() ax1 =…
Elenium
  • 348
  • 3
  • 9
1
vote
1 answer

convert bezier curve with N point to many cubic bezier curve

I have bezier curve with about 48 ctrl points and I want to transform it to many cubic bezier curves... Any algorthim , math theory or just a link may help :) ??
Humam Helfawi
  • 55
  • 1
  • 4
1
vote
1 answer

Cubic textures and pixel formats in Ogre3D

In the Ogre material file, the cubic texture is defined as: cubic_texture separateUV Does this mean that it's impossible to set the pixel format as is the case with normal textures? texture
Bill Kotsias
  • 3,258
  • 6
  • 33
  • 60
1
vote
0 answers

interplating 3d matrix by cubic spline

Map provides a 185 x 250 x 3 matrix Map representing an image and “image coordinates” xi and yi. interpolation coordinates 5 < x < 180 and 5 < y < 245, both evenly spaced with spacing 0.1. Interpolate each of the 3 blocks of size 185 x 250 of the…
Amit Kadam
  • 11
  • 2
0
votes
1 answer

Python function: How to calculate x in a cubic equation using python

How to find the value of x from the equation calculate_density(x)? I have the following Python function: a = 5108.30 b = 3967550 c = -281375000 pressure = 100 def calculate_density(x): density = (a * x + b * x**2 + c * x**3) * pressure …
ryan
  • 1
  • 1
0
votes
1 answer

Problem with the use of parameter method in scipy.interpolate.interpn

scipy.interpolate.interpn(points, values, xi, method='linear', bounds_error=True, fill_value=nan)[source] The data dimension I want to interpolate is three-dimensional. The dimensions are like this [90, 180, 8]. When the parameter method is set to…
sangyc10
  • 3
  • 1
0
votes
1 answer

Calculate the new control points for cubic Bezier curve in Android Canvas

In the application I am developing currently, I am having a challenge drawing a bezire curve between start and end points to join 2 lines as shown in the image below. The distance between the lines are 10dp as marked in the image. I needed a solid…
0
votes
2 answers

How to apply Least Squares for curve fitting of Parametric Polynomial Cubic Curve

Given the parametric planar curve, r(u)=(x(u), y(u)) whereby x=f(u), y=g(u), perform curve fitting to find an approximation to r(u) with a parametric polynomial cubic curve. Will need to apply Least Squares estimation to solve the…