This file contains 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
from functools import reduce | |
import math | |
def calculate_area(sides, opposite_angles_degrees): | |
''' | |
Calculate the area of a quadrilateral using Bretschneider's Formula | |
from the lengths of the sides and either pair of OPPOSITE angles. | |
Arguments:- |
This file contains 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
import quadrilateralareas | |
def main(): | |
print("---------------------------") | |
print("| codedrome.com |") | |
print("| Areas of Quadrilaterals |") | |
print("---------------------------\n") |
This file contains 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
def square(side): | |
return side ** 2 | |
def rectangle(width, height): | |
return width * height | |
This file contains 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
import math | |
import numpy as np | |
def main(): | |
print("--------------------------------") | |
print("| codedrome.com |") | |
print("| Geometric and Harmonic Means |") | |
print("--------------------------------\n") |
This file contains 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
"use strict" | |
window.onload = function() | |
{ | |
arc(); | |
// pieSlice(); | |
// pieChart(); |
This file contains 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
"use strict" | |
function drawArc(settings) | |
{ | |
let d = ""; | |
const firstCircumferenceX = settings.centreX + settings.radius * Math.cos(settings.startAngleRadians); | |
const firstCircumferenceY = settings.centreY + settings.radius * Math.sin(settings.startAngleRadians); | |
const secondCircumferenceX = settings.centreX + settings.radius * Math.cos(settings.startAngleRadians + settings.sweepAngleRadians); |
This file contains 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
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"/> | |
<title>SVG Arc and Pie Slice</title> | |
</head> | |
</body> |
This file contains 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
"use strict" | |
window.onload = function() | |
{ | |
const plotter = new ParametricEquationsPlotter(); | |
const pe = ParametricEquations.circle; | |
// const pe = ParametricEquations.ellipse; | |
// const pe = ParametricEquations.cardioid; | |
// const pe = ParametricEquations.spiral; |
This file contains 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
const ParametricEquations = | |
{ | |
circle: | |
{ | |
xFunction: function (t) {return Math.cos(t)}, | |
yFunction: function (t) {return Math.sin(t)}, | |
zFunction: function (t) {return 0}, | |
tRange: {start: 0, end: 2 * Math.PI}, | |
tStep: Math.PI / 32, | |
colour: "#FF0000" |
This file contains 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
class ParametricEquationsPlotter | |
{ | |
constructor() | |
{ | |
this._container = null, | |
this._renderer = null, | |
this._scene = null, | |
this._light = null, | |
this._camera = null, | |
this._group = null, |