Path: blob/master/sage/schemes/plane_quartics/quartic_constructor.py
4057 views
"""1Quartic curve constructor2"""34#*****************************************************************************5# Copyright (C) 2006 David Kohel <[email protected]>6# Distributed under the terms of the GNU General Public License (GPL)7# http://www.gnu.org/licenses/8#*****************************************************************************910from sage.schemes.generic.all import is_ProjectiveSpace, ProjectiveSpace11from sage.rings.all import is_MPolynomial1213from quartic_generic import QuarticCurve_generic1415#from sage.rings.all import is_FiniteField, is_RationalField1617def QuarticCurve(F,PP=None,check=False):18"""19Returns the quartic curve defined by F.20"""21if not PP is None:22if not is_ProjectiveSpace(PP) and PP.dimension == 2:23raise TypeError, "Argument PP (=%s) must be a projective plane"%PP24elif not is_MPolynomial(F):25raise TypeError, \26"Argument F (=%s) must be a homogeneous multivariate polynomial"%F27else:28if not F.is_homogeneous():29"Argument F (=%s) must be a homogeneous polynomial"%F30P = F.parent()31if P.ngens() != 3:32"Argument F (=%s) must be a homogeneous multivariate polynomial in 3 variables"%F33PP = ProjectiveSpace(P)34if check:35raise TypeError, "Argument checking (for nonsingularity) is not implemented."36return QuarticCurve_generic(PP, F)373839