This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Generates Bezier polynomials in x and y for use in Geogebra | |
| % | |
| % | |
| % Input(s) | |
| % n: Degree of Bezier curve | |
| % | |
| % Output(s) | |
| % cStr: String used to define Bezier curve in Geogebra | |
| % | |
| % Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| turtles-own [speed radius turn-angle] | |
| to setup | |
| setup-circle | |
| reset-ticks | |
| end | |
| to setup-circle | |
| clear-all | |
| set-default-shape turtles "dot" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Filters vectors for KenKen game | |
| Inputs | |
| v: vector | |
| c: Number of elements in the sum (size of the KenKen cell) | |
| n: Maximum value in the sum (length of a side in the game) | |
| u: T/F flag for uniqueness. Set if the cell is contained in a single row or column | |
| e: Exclusion set vector. Numbers appearing in the same row or column as the cell |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Returns a vector of the unique elements of v | |
| Input | |
| v: vector | |
| Output | |
| u: Vector of unique elements of v | |
| Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Returns the number of multiplicative partitions of integer n | |
| Ref: https://oeis.org/A001055 | |
| https://oeis.org/A162247 | |
| https://oeis.org/A162247/a162247.txt | |
| Inputs: | |
| n: Non-negative integer | |
| m: Maximum factor (optional) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Returns the multiplicative partition of integer n | |
| Ref: https://oeis.org/A001055 | |
| https://oeis.org/A162247 | |
| https://oeis.org/A162247/a162247.txt | |
| Inputs: | |
| n: Non-negative integer | |
| Output: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Monty Hall problem simulation | |
| # | |
| # Parameters | |
| # ---------- | |
| # n: Number of samples | |
| # | |
| # Returns | |
| # ------- | |
| # p: Probability of winning | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| % Opens a .ply mesh file, creates mesh structure with faces, vertices | |
| % Requires plyread function: | |
| % https://www.mathworks.com/matlabcentral/fileexchange/47484-plyread-m?s_tid=srchtitle | |
| % https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/47484/versions/1/previews/plyread.m/index.html | |
| % | |
| % | |
| % Input(s) | |
| % plyFile: Name of .ply file to read (inc. path) | |
| % | |
| % Output(s) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| Finds the minimal solution to a Pell's equation, a^2 - nb^2 = 1 for given n | |
| Inputs: | |
| n: Non-negative integer | |
| Output: | |
| a,b: Minimal solution to Pell's equation | |
| Example: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Skiena probability in 1-on-1 match | |
| # Based on Skiena "Calculated Bets" | |
| # | |
| # Parameters | |
| # ---------- | |
| # a,b: Probability of win against all competitors for Teams A, B | |
| # | |
| # | |
| # Returns | |
| # ------- |
OlderNewer