polynomial-math

How do you compute the XOR Remainder used in CRC?

I'm trying to remember how the math is worked out to compute the remainder of an XOR algorithm in Cyclical Redundancy Checks to verify the remainder bits of a network message. I shouldn't have tossed that text book. This is easily done in code, but how is it worked out by hand? I know it looks something like a standard division algori...

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? ...

Object-Oriented Programming: Java.Polynomial -- should methods be 'destructive'?

I have to implement Java.Polynomial as a school assignment. Part of the methods are add(polynomial), multiply(polynomial) etc. In the case of something like p.add(q); // computes p + q is it better to return void and keep the sum of the polynomials in p? or is it better to return a polynomial and keep the former value of p intact? M...

Suggestions for factorising polynomials

As part of some volunteer work for our local school. I was wondering about putting some kind of GUI (Windows) software together to guide the students through the process of factorising polynomials e.g. a step-by-step guide of how to get from: x**2 + 2x - 3 to (x + 3)(x - 1) This would preferably be C# but Java is also OK. There is c...

polynomial multiplication using fastfourier transform

i am going through the above topic from CLRS(CORMEN) (page 834) and I got stuck at this point. Can anybody please explain how the following expression, A(x)=A^{[0]}(x^2) +xA^{[1]}(x^2) follows from, n-1 ` Σ a_j x^j j=0 Where, A^{[0]} = a_0 + a_2x + a_4a^x ... a_{n-2}x^{\frac{n}{2-1}} A^{[1]} = a_1 + a_3x + ...

Color Interpolation

Okay, so I'm looking at a typical color chooser and it looks something like this: If we deal with only highly saturated colors, the blending pattern behaves like this: R 255 G 0 B 0 R 255 G 0 -> 255 B 0 R 255 G 255 B 0 R 255 -> 0 G 255 B 0 R 0 G 255 B 0 R 0 G 255 B 0 -> 255 R 0 G 255 B 255 R 0 G 255 -> 0 B 255 ...

C++ overloading * for polynomial multiplication

So I have been developing a polynomial class where a user inputs: 1x^0 + 2x^1 + 3x^2... and 1,2,3 (the coefficients) are stored in an int array My overloaded + and - functions work, however, * doesnt work. No matter the input, it always shows -842150450 when is should be (5x^0 + x^1) * (-3x^0 + x^1) = -15x^0 + 2x^1 + 1x^2 or (x+5)(x-...

Fastest algorithm for evaluating large polynomials

Hey everyone. A rather general question, what is the fastest (in terms of time complexity) algorithm for evaluating polynomials of Degree 400 to 500. Thanks in advance. ...

Where can I find line buffering code?

I can't find any code for doing this. The only places I can find it is in GIS APIs. Preferably in java, but I can port other languages too. I'd even settle for a overview of all the formulas required. ...

Calculating the area underneath a mathematical function

I have a range of data that I have approximated using a polynomial of degree 2 in Python. I want to calculate the area underneath this polynomial between 0 and 1. Is there a calculus, or similar package from numpy that I can use, or should I just make a simple function to integrate these functions? I'm a little unclear what the best ap...

Implementing Recursion from psuedo-code (NTRUEncrypt)

Hello again everyone. I am required to implement the NTRU Public Key Cyptosystem as part of my final year University project. I'm trying to implement an algorithm that multiplies long polynomials via recursion, however I'm quite bogged down in trying to understand the pseudo-code. Algorithm PolyMult(c, b, a, n, N) Require: N, n, and the...

Polynomial Calculator

Hello all, I'm doing a polynomial calculator and i'll need some help as i'll progress with the code. For now I made only the polinom class which i represented it as a linked list with terms and some functions(only read and print the polynomial functions for now). Here's the main program which for now only read a polynomial and prints i...

Basic polynomial reading using linked lists

Ok, after failing to read a polynomial, I'm trying first a basic approach to this. So i have class polinom with function read and print: #ifndef _polinom_h #define _polinom_h #include <iostream> #include <list> #include <cstdlib> #include <conio.h> using namespace std; class polinom { class term { public: double...

Algorithm for computing the inverse of a polynomial

I'm looking for an algorithm (or code) to help me compute the inverse a polynomial, I need it for implementing NTRUEncrypt. An algorithm that is easily understandable is what I prefer, there are pseudo-codes for doing this, but they are confusing and difficult to implement, furthermore I can not really understand the procedure from pseud...

Polynomial operations using operator overloading (resolved)

I'm trying to use operator overloading to define the basic operations (+,-,*,/) for my polynomial class but when i run the program it crashes and my computer frozes. Update4 Ok. i successfully made three of the operations, the only one left is division. Here's what I got: polinom operator*(const polinom& P) const { polinom Result...

Polynomial division overloading operator (solved)

Ok. here's the operations i successfully code so far thank's to your help: Adittion: polinom operator+(const polinom& P) const { polinom Result; constIter i = poly.begin(), j = P.poly.begin(); while (i != poly.end() && j != P.poly.end()) { //logic while both iterators are valid if (i->pow > j->pow) { //if the cu...

NTRU Pseudo-code for computing Polynomial Inverses

Hello all. I was wondering if anyone could tell me how to implement line 45 of the following pseudo-code. Require: the polynomial to invert a(x), N, and q. 1: k = 0 2: b = 1 3: c = 0 4: f = a 5: g = 0 {Steps 5-7 set g(x) = x^N - 1.} 6: g[0] = -1 7: g[N] = 1 8: loop 9: while f[0] = 0 do 10: for i = 1 to N do 11: f[i ...

polynomial surface fit numpy

I have had that problem before and I couldn't solve it how do I fit a 2d surface z=f(x,y) with a polynomial in numpy (full crossterms). Thanks in advance, Wolfgang ...

Good Package for Fitting Polynomial Trend Lines

Given a simple data set, I would like to be able to calculate a trending formula given it's a second order polynomial regression. In fact, it would be great if one could even forecast X periods during calculation (similar to what Excel does). I'm looking for a portable C/C++ package that's relatively easy to use, and allows it to spit ...

Looking for JavaScript Math library

Is there any JavaScript or jQuery plugin Math Library with polynomial fit routines? ...