Repository navigation
Custom SageMath Functionality
Drew Lewis edited this page Feb 27, 2025
·
13 revisions
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
)TBIL.numberline_plot(
center=0,
radius=10
)TBIL.inequality_plot(
start=None,
strict_start=True,
end=None,
strict_end=True,
label_endpoints=True,
scale=10
)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
)