ROS Code
 All Classes Namespaces Files Functions Variables
ros.maths Namespace Reference

Functions

def autosolve
 
def autohard
 
def equation
 
def scientific
 
def fracsimplify
 
def circleconvert
 
def amountdiv
 
def constant
 
def power
 
def squareroot
 
def factorial
 
def average
 
def numprop
 
def posnegtoggle
 
def isinfinite
 
def isfalse
 
def less_or_equal
 
def compare
 
def factors
 
def eulercalc
 
def randomnum
 
def isfib
 
def isprime
 
def convertbase
 
def isnum
 
def quadrant
 
def flipcoords
 
def lcm
 
def hcf
 
def pythrule
 

Function Documentation

def ros.maths.amountdiv (   number,
  minnum,
  maxnum 
)

Definition at line 154 of file maths.py.

def ros.maths.autohard (   equation)

Definition at line 37 of file maths.py.

def ros.maths.autosolve (   equation)

Definition at line 13 of file maths.py.

def ros.maths.average (   numbers,
  averagetype = 'mean' 
)

Definition at line 207 of file maths.py.

def ros.maths.circleconvert (   amount,
  currentformat,
  newformat 
)

Definition at line 129 of file maths.py.

def ros.maths.compare (   value1,
  value2,
  comparison 
)

Definition at line 296 of file maths.py.

def ros.maths.constant (   constanttype)

Definition at line 165 of file maths.py.

def ros.maths.convertbase (   number,
  base = 10 
)
Convert a number in base 10 to another base

number:
The number to convert

base:
The base to convert to. Default is 10.

Definition at line 412 of file maths.py.

def ros.maths.equation (   operation,
  firstnum,
  secondnum 
)

Definition at line 67 of file maths.py.

def ros.maths.eulercalc (   faces,
  edges,
  verticies 
)
Calculate the value of Euler's formula of a shape

faces:
The faces of the shape

edges:
The edges of the shape

verticies:
The verticies of the shape

Definition at line 330 of file maths.py.

def ros.maths.factorial (   n)

Definition at line 198 of file maths.py.

def ros.maths.factors (   number)
Find all of the factors of a number and return it as a list

number:
The number to find the factors for

Definition at line 313 of file maths.py.

def ros.maths.flipcoords (   xcoord,
  ycoord,
  axis 
)
Flip the coordinates over a specific axis, to a different quadrant

xcoord:
The x coordinate to flip

ycoord:
The y coordinate to flip

axis:
The axis to flip across. Could be 'x' or 'y'

Definition at line 480 of file maths.py.

def ros.maths.fracsimplify (   numerator,
  denominator 
)

Definition at line 111 of file maths.py.

def ros.maths.hcf (   num1,
  num2 
)
Find the highest common factor of 2 numbers

num1:
The first number to find the hcf for

num2:
The second number to find the hcf for

Definition at line 536 of file maths.py.

def ros.maths.isfalse (   variable)

Definition at line 277 of file maths.py.

def ros.maths.isfib (   number)
Check if a number is in the Fibonacci sequence

number:
Number to check

Definition at line 371 of file maths.py.

def ros.maths.isinfinite (   variable)

Definition at line 270 of file maths.py.

def ros.maths.isnum (   value)
Check if a value is a type of number (decimal or integer)

value:
The value to check

Definition at line 439 of file maths.py.

def ros.maths.isprime (   number)
Check if a number is a prime number

number:
The number to check

Definition at line 394 of file maths.py.

def ros.maths.lcm (   num1,
  num2 
)
Find the lowest common multiple of 2 numbers

num1:
The first number to find the lcm for

num2:
The second number to find the lcm for

Definition at line 513 of file maths.py.

def ros.maths.less_or_equal (   number)

Definition at line 286 of file maths.py.

def ros.maths.numprop (   value,
  propertyexpected 
)

Definition at line 233 of file maths.py.

def ros.maths.posnegtoggle (   number)

Definition at line 258 of file maths.py.

def ros.maths.power (   number,
  power 
)

Definition at line 184 of file maths.py.

def ros.maths.pythrule (   first,
  second 
)
Calculate the area of a right angled trangle based on Pythagoras' Theorem

first:
The length of the first axis (x or y)

second:
The length of the second axis (x or y)

Definition at line 558 of file maths.py.

def ros.maths.quadrant (   xcoord,
  ycoord 
)
Find the quadrant a pair of coordinates are located in

xcoord:
The x coordinate to find the quadrant for

ycoord:
The y coordinate to find the quadrant for

Definition at line 455 of file maths.py.

def ros.maths.randomnum (   minimum = 1,
  maximum = 2 
)
Generate a random number

minimum:
The minimum number to generate. Default is 1.

maximum:
The maximum number to generate. Default is 10.

Definition at line 349 of file maths.py.

def ros.maths.scientific (   number,
  operation,
  number2 = None,
  logbase = 10 
)

Definition at line 89 of file maths.py.

def ros.maths.squareroot (   number)

Definition at line 191 of file maths.py.