blob: 7be94e5b903b536158278baa2ddd9d4f84f6d199 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
# coding=utf-8
from .simplenode import SimpleNode
from gettext import gettext as _
import math
class Pi(SimpleNode):
"""Node representing pi."""
CLASS = "pi"
background = SimpleNode.loadbackground("pi.svg")
title = _("π")
description = _(u"Returns the ratio of a circle's circumference to its "
u"diameter.\n"
u"π (pi) is approximately 3.14159")
def __call__(self, x):
"""Returns pi."""
return math.pi
def get_equation_string(self, variable):
"""Returns pi, ignoring the variable."""
return "pi"
|