On Friday 24 December 2010, lainme wrote:
> Hi, I want to do polynomial interpolation with sage, such as the
> Lagrange Interpolation
> 
> I searched the group and reference manual of sage, but only found the
> complex interpolation.
> 
> Does there a simple way to do this?

sage: K = GF(32003)
sage: P.<x> = K[]
sage: P.lagrange_polynomial([(K.random_element(),K.random_element()) for _ in 
range(10)])
25484*x^9 + 16230*x^8 + 21258*x^7 + 5369*x^6 + 5329*x^5 + 26390*x^4 + 
18568*x^3 + 24278*x^2 + 26684*x + 4684

Cheers,
Martin

-- 
name: Martin Albrecht
_pgp: http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x8EF0DC99
_otr: 47F43D1A 5D68C36F 468BAEBA 640E8856 D7951CCF
_www: http://martinralbrecht.wordpress.com/
_jab: [email protected]

-- 
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org

Reply via email to