Repository navigation
Custom SageMath Functionality
Authors can use the custom TBIL SageMath module in either SagePlots:
<image>
<sageplot>
<xi:include parse="text" href="../../../common/sagemath/library.sage"/>
# code goes here, fully flush left (the above line needs to also be fully flushed left)
</sageplot>
</image>
and in CheckIt generators:
# at top of file
load("../../../source/common/sagemath/library.sage")
See below for various options, along with their defaults if not provided. (If this page gets stale, see the code at https://github.com/TeamBasedInquiryLearning/library/blob/main/source/common/sagemath/library.sage for the most up-to-date versions.)
TBIL.plot_angle(
angle, # in radians, multiply degrees by pi/180
reference_angle=0,
show_axes=True,
show_unit_circle=False,
show_unit_point=False,
show_angle_value=False
)
plot_angle() is a function useful for plotting diagrams showing angles around the unit circle. It takes one mandatory argument, the angle, and other arguments can be set to True to provide various decorations.
TBIL.plot_angle(pi/3,show_unit_circle=True)

TBIL.numberline_plot(
center=0,
radius=10
)
Generates a numberline. You can specify the center as well as the radius.
TBIL.numberline_plot(center=5,radius=15)

TBIL.inequality_plot(
start=None,
strict_start=True,
end=None,
strict_end=True,
label_endpoints=True,
scale=10
)
Generates decorations for a numberline_plot to represent inequalities. To have endpoints at infinity, you can omit the start or end parameters. The scale parameter should match the radius of a numberline_plot; both default to 10.
p=TBIL.numberline_plot(radius=15)
p+=TBIL.inequality_plot(start=8,strict_start=False,label_endpoints=False,scale=15)
p.axes(False)

TBIL.intervals_from_inequality(
inequality,
partition_points,
undefined_points=None,
checkpoints=None
)
TBIL.numberline_from_intervals(
intervals
)
def small_rationals(
numerators=range(-8,9),
denominators=None, # defaults to [2,3,5]
dictionary=True,
length=1
)
'''Generates a list or dictionary of unique rational numbers with small numerators and denominators.
For a dictionary, keys are the rationals and values are the denominators.'''
TBIL.small_irrationals(
rational_part=range(-8,9),
irrational_part=None,
denominators=None,
dictionary=True,
length=1,
full_list=False
)