Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@sign(Point, Point)
def initfrompoint(self, p):
self.geo = p.geo
@sign(ElementFactory, Number)
def initfromnumber(self, factory, x):
expr = factory.api.numberExpression(float(x))
Expression.__init__(self, factory, expr)
@Point.init.spec
@sign(Point, Point)
def initfrompoint(self, p):
self.geo = p.geo
@sign(VectorThing)
def initfromexpr(self, e):
self.geo = self._api.geoVector(self._factory.expression(e).expr)
@sign(Point, Point, Point)
def initfrom3points(self, p, q, r):
self.geo = self._api.geoCirclePPP(p.geo, q.geo, r.geo)
@sign(Point, Numeric)
def initfromcentreandradius(self, c, r):
self.geo = self._api.geoCircleCR(
c.geo,
self._factory.element(r).geo
)
@sign(Line, Conic)
def lineconic(self, l, c):
return self._api.intersectLineConic(l.geo, c.geo)
@specmethod.init
@sign(Point, Numeric)
def initfromcentreandradius(self, c, r):
self.geo = _kernel.Circle(None, c.geo, element(r).geo)
@sign(ElementFactory, NumberThing, NumberThing)
def initfromcoords(self, factory, x, y):
x, y = factory.expression(x), factory.expression(y)
expr = factory.api.vectorExpression(x.expr, y.expr)
Expression.__init__(self, factory, expr)
@Line.init.spec
@sign(Line, Point, Line)
def initfrompointandline(self, p, l):
return _kernel.Line(None, p.geo, l.geo)