Support Functions

Point

point = numpy.array([x,y,1])
point = numpy.array([x,y,z,1])

transformation_matrix.py

mx = get_identity_matrix_2d()
mx = get_identity_matrix_3d()
mx = get_translation_matrix_2d(dx,dy)
mx = get_translation_matrix_3d(dx,dy,dz)
mx = get_z_rotation_matrix_2d(deg)
mx = get_x_rotation_matrix_3d(deg)
mx = get_y_rotation_matrix_3d(deg)
mx = get_z_rotation_matrix_3d(deg)
mx = get_scaling_matrix_2d(sx,sy)
mx = get_scaling_matrix_3d(sx,sy,sz)

coordinate_conversion.py

(cx,cy) = win_to_center_coords(wx,wy,win_width,win_height)
(wx,wy) = center_to_win_coords(cx,cy,win_width,win_height)

user_interface.py

tf = running_python3()
s = get_user_input(prompt)
pause()
clear_screen()
(tf,n) = is_float(s)
(tf,n) = is_int(s)
tf = is_a_number(s)

split_into_parameters.py (uses regular expressions)

plst = split_into_parameters(s)

replace_commas_and_split.py (uses string methods)

plst = replace_commas_and_split(s)

my_parse_csv.py

plst = parse_csv(s)

normal_vector.py

nv = calc_cross_product(pt1,pt2,pt3)

notes

tf = booelan (True,False)

deg = angle in degrees

plst = list of parameters from a string

nv = [x,y,z] (a vector has magnitude and direction, but not position)

import transformation_matrix as tm import coordinate_conversion as cc import user_interface as ui from normal_vector import calc_cross_product from replace_comma_and_split import * from graphics import * import numpy as np import platform, os, sys