codeberg copy

This commit is contained in:
CatAClock 2025-04-15 11:51:57 -07:00
commit a9fe06e8e3
27 changed files with 1692 additions and 0 deletions

2
.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
# Godot 4+ specific ignores
.godot/

7
LICENSE.md Normal file
View file

@ -0,0 +1,7 @@
Copyright 2024 "Crowded Games Group"
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

View file

@ -0,0 +1,26 @@
[gd_scene load_steps=2 format=3 uid="uid://cj0uj04i3vy83"]
[ext_resource type="Script" path="res://Scripts/DifferentOptionsScroll.gd" id="1_vqqjb"]
[node name="OptionButton" type="OptionButton"]
custom_minimum_size = Vector2(400, 0)
anchors_preset = -1
anchor_left = 0.25
anchor_top = 0.95
anchor_right = 0.25
anchor_bottom = 0.95
offset_top = -6.10352e-05
offset_right = 400.0
offset_bottom = 39.9999
item_count = 4
popup/item_0/text = "Basic Calculator"
popup/item_0/id = 0
popup/item_1/text = "Shape Calculator"
popup/item_1/id = 1
popup/item_2/text = "Matrix Calculator"
popup/item_2/id = 2
popup/item_3/text = "Other Functions"
popup/item_3/id = 3
script = ExtResource("1_vqqjb")
[connection signal="item_selected" from="." to="." method="_on_item_selected"]

View file

@ -0,0 +1,317 @@
[gd_scene load_steps=13 format=3 uid="uid://blletw6rrhjr7"]
[ext_resource type="Script" path="res://Scripts/BasicCalculator.gd" id="1_vmkkw"]
[ext_resource type="StyleBox" uid="uid://bgd3kkjp56k6t" path="res://Style/NormalCalc.tres" id="2_gt3fn"]
[ext_resource type="StyleBox" uid="uid://bfnnrhuw8yyar" path="res://Style/NormalInstant.tres" id="2_xjvyb"]
[ext_resource type="StyleBox" uid="uid://bakatxtwoh52x" path="res://Style/HoverInstant.tres" id="3_c8wjg"]
[ext_resource type="StyleBox" uid="uid://cqpag6x74x8wv" path="res://Style/HoverCalc.tres" id="3_ny0km"]
[ext_resource type="StyleBox" uid="uid://b76lg563f17a1" path="res://Style/PressedCalc.tres" id="4_5juj0"]
[ext_resource type="StyleBox" uid="uid://263e7dk41d7p" path="res://Style/PressedInstant.tres" id="4_s3ro4"]
[ext_resource type="StyleBox" uid="uid://blrv60yt0gbld" path="res://Style/FocusAll.tres" id="5_e2rgu"]
[ext_resource type="StyleBox" uid="uid://dx4v7hg5h47sm" path="res://Style/NormalOperator.tres" id="6_e2yyp"]
[ext_resource type="PackedScene" uid="uid://cj0uj04i3vy83" path="res://Scenes/DifferentOptionsScroll.tscn" id="6_no6pg"]
[ext_resource type="StyleBox" uid="uid://bh5m8n5nsrrs4" path="res://Style/HoverOperator.tres" id="7_p05ac"]
[ext_resource type="StyleBox" uid="uid://cd8st43btla0m" path="res://Style/PressedOperator.tres" id="8_0e5x0"]
[node name="Calculator" type="Control" node_paths=PackedStringArray("Text")]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_vmkkw")
Text = NodePath("Text")
[node name="Text" type="LineEdit" parent="."]
layout_mode = 0
offset_right = 800.0
offset_bottom = 80.0
placeholder_text = "Input Math Here"
[node name="Row1" type="Control" parent="."]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Add" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 20.0
offset_top = 100.0
offset_right = 60.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "+"
[node name="Subtract" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 80.0
offset_top = 100.0
offset_right = 120.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "-"
[node name="Multiply" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 140.0
offset_top = 100.0
offset_right = 180.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "x"
[node name="Divide" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 200.0
offset_top = 100.0
offset_right = 240.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "/"
[node name="Root" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 260.0
offset_top = 100.0
offset_right = 305.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "Root"
[node name="Power" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 320.0
offset_top = 100.0
offset_right = 365.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "Pow"
[node name="PowEuler" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 380.0
offset_top = 100.0
offset_right = 425.0
offset_bottom = 140.0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
theme_override_styles/normal = ExtResource("2_xjvyb")
theme_override_styles/hover = ExtResource("3_c8wjg")
theme_override_styles/pressed = ExtResource("4_s3ro4")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "E^x"
[node name="RootEuler" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 440.0
offset_top = 100.0
offset_right = 485.0
offset_bottom = 140.0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
theme_override_styles/normal = ExtResource("2_xjvyb")
theme_override_styles/hover = ExtResource("3_c8wjg")
theme_override_styles/pressed = ExtResource("4_s3ro4")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "ln(x)"
[node name="Log" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 493.0
offset_top = 100.0
offset_right = 551.0
offset_bottom = 140.0
theme_override_styles/normal = ExtResource("6_e2yyp")
theme_override_styles/hover = ExtResource("7_p05ac")
theme_override_styles/pressed = ExtResource("8_0e5x0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "Log⬇x"
[node name="Factorial" type="Button" parent="Row1"]
layout_mode = 0
offset_left = 560.0
offset_top = 100.0
offset_right = 600.0
offset_bottom = 140.0
theme_override_colors/font_color = Color(0, 0, 0, 1)
theme_override_colors/font_pressed_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_color = Color(0, 0, 0, 1)
theme_override_colors/font_focus_color = Color(0, 0, 0, 1)
theme_override_colors/font_hover_pressed_color = Color(0, 0, 0, 1)
theme_override_styles/normal = ExtResource("2_xjvyb")
theme_override_styles/hover = ExtResource("3_c8wjg")
theme_override_styles/pressed = ExtResource("4_s3ro4")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "int !"
[node name="Row2" type="Control" parent="."]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="One" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 20.0
offset_top = 160.0
offset_right = 60.0
offset_bottom = 200.0
text = "1"
[node name="Two" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 80.0
offset_top = 160.0
offset_right = 120.0
offset_bottom = 200.0
text = "2"
[node name="Three" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 140.0
offset_top = 160.0
offset_right = 180.0
offset_bottom = 200.0
text = "3"
[node name="Four" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 200.0
offset_top = 160.0
offset_right = 240.0
offset_bottom = 200.0
text = "4"
[node name="Five" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 260.0
offset_top = 160.0
offset_right = 305.0
offset_bottom = 200.0
text = "5"
[node name="Six" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 320.0
offset_top = 160.0
offset_right = 365.0
offset_bottom = 200.0
text = "6"
[node name="Seven" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 380.0
offset_top = 160.0
offset_right = 425.0
offset_bottom = 200.0
text = "7"
[node name="Eight" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 440.0
offset_top = 160.0
offset_right = 485.0
offset_bottom = 200.0
text = "8"
[node name="Nine" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 500.0
offset_top = 160.0
offset_right = 540.0
offset_bottom = 200.0
text = "9"
[node name="Zero" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 560.0
offset_top = 160.0
offset_right = 600.0
offset_bottom = 200.0
text = "0
"
[node name="Period" type="Button" parent="Row2"]
layout_mode = 0
offset_left = 620.0
offset_top = 160.0
offset_right = 660.0
offset_bottom = 200.0
text = ".
"
[node name="AC" type="Button" parent="."]
layout_mode = 0
offset_left = 680.0
offset_top = 700.0
offset_right = 725.0
offset_bottom = 740.0
theme_override_styles/normal = ExtResource("2_gt3fn")
theme_override_styles/hover = ExtResource("3_ny0km")
theme_override_styles/pressed = ExtResource("4_5juj0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "AC"
[node name="Equals" type="Button" parent="."]
layout_mode = 0
offset_left = 740.0
offset_top = 700.0
offset_right = 780.0
offset_bottom = 740.0
theme_override_styles/normal = ExtResource("2_gt3fn")
theme_override_styles/hover = ExtResource("3_ny0km")
theme_override_styles/pressed = ExtResource("4_5juj0")
theme_override_styles/focus = ExtResource("5_e2rgu")
text = "="
[node name="OptionButton" parent="." instance=ExtResource("6_no6pg")]
layout_mode = 1
[connection signal="text_changed" from="Text" to="." method="GetKeyInput"]
[connection signal="pressed" from="Row1/Add" to="." method="Operation_Change" binds= ["Add"]]
[connection signal="pressed" from="Row1/Subtract" to="." method="Operation_Change" binds= ["Subtract"]]
[connection signal="pressed" from="Row1/Multiply" to="." method="Operation_Change" binds= ["Multiply"]]
[connection signal="pressed" from="Row1/Divide" to="." method="Operation_Change" binds= ["Divide"]]
[connection signal="pressed" from="Row1/Root" to="." method="Operation_Change" binds= ["Root"]]
[connection signal="pressed" from="Row1/Power" to="." method="Operation_Change" binds= ["Pow"]]
[connection signal="pressed" from="Row1/PowEuler" to="." method="Instant_Calculate" binds= ["PowEuler"]]
[connection signal="pressed" from="Row1/RootEuler" to="." method="Instant_Calculate" binds= ["RootEuler"]]
[connection signal="pressed" from="Row1/Log" to="." method="Operation_Change" binds= ["Log"]]
[connection signal="pressed" from="Row1/Factorial" to="." method="Instant_Calculate" binds= ["Factorial"]]
[connection signal="pressed" from="Row2/One" to="." method="AddNumber" binds= [1]]
[connection signal="pressed" from="Row2/Two" to="." method="AddNumber" binds= [2]]
[connection signal="pressed" from="Row2/Three" to="." method="AddNumber" binds= [3]]
[connection signal="pressed" from="Row2/Four" to="." method="AddNumber" binds= [4]]
[connection signal="pressed" from="Row2/Five" to="." method="AddNumber" binds= [5]]
[connection signal="pressed" from="Row2/Six" to="." method="AddNumber" binds= [6]]
[connection signal="pressed" from="Row2/Seven" to="." method="AddNumber" binds= [7]]
[connection signal="pressed" from="Row2/Eight" to="." method="AddNumber" binds= [8]]
[connection signal="pressed" from="Row2/Nine" to="." method="AddNumber" binds= [9]]
[connection signal="pressed" from="Row2/Zero" to="." method="AddNumber" binds= [0]]
[connection signal="pressed" from="Row2/Period" to="." method="AddString" binds= ["."]]
[connection signal="pressed" from="AC" to="." method="Scrub"]
[connection signal="pressed" from="Equals" to="." method="Calculate"]

View file

@ -0,0 +1,99 @@
[gd_scene load_steps=3 format=3 uid="uid://bx1ggecby8xu1"]
[ext_resource type="Script" path="res://Scripts/Functions.gd" id="1_s06w2"]
[ext_resource type="PackedScene" uid="uid://cj0uj04i3vy83" path="res://Scenes/DifferentOptionsScroll.tscn" id="2_5e44h"]
[node name="Functions" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_s06w2")
[node name="OptionButton" parent="." instance=ExtResource("2_5e44h")]
layout_mode = 0
anchors_preset = 0
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
offset_left = 200.0
offset_top = 760.0
offset_right = 600.0
offset_bottom = 800.0
[node name="ArithmeticSeq" type="Label" parent="."]
layout_mode = 0
offset_right = 96.0
offset_bottom = 26.0
text = "Arithmetic Sequence"
[node name="Nth" type="LineEdit" parent="ArithmeticSeq"]
layout_mode = 0
offset_top = 20.0
offset_right = 161.0
offset_bottom = 51.0
placeholder_text = "Nth Number"
[node name="First Number" type="LineEdit" parent="ArithmeticSeq"]
layout_mode = 0
offset_top = 51.0
offset_right = 161.0
offset_bottom = 82.0
placeholder_text = "First Number"
[node name="Common Diff" type="LineEdit" parent="ArithmeticSeq"]
layout_mode = 0
offset_top = 81.0
offset_right = 161.0
offset_bottom = 112.0
placeholder_text = "Common Diff"
[node name="Submit" type="Button" parent="ArithmeticSeq"]
layout_mode = 0
offset_left = 46.0
offset_top = 113.0
offset_right = 109.0
offset_bottom = 144.0
text = "Submit"
[node name="GeometricSeq" type="Label" parent="."]
layout_mode = 0
offset_left = 162.0
offset_right = 322.0
offset_bottom = 26.0
text = "Geometric Sequence"
[node name="Nth" type="LineEdit" parent="GeometricSeq"]
layout_mode = 0
offset_top = 20.0
offset_right = 161.0
offset_bottom = 51.0
placeholder_text = "Nth Number"
[node name="First Number" type="LineEdit" parent="GeometricSeq"]
layout_mode = 0
offset_top = 51.0
offset_right = 161.0
offset_bottom = 82.0
placeholder_text = "First Number"
[node name="Common Ratio" type="LineEdit" parent="GeometricSeq"]
layout_mode = 0
offset_top = 81.0
offset_right = 161.0
offset_bottom = 112.0
placeholder_text = "Common Ratio"
[node name="Submit" type="Button" parent="GeometricSeq"]
layout_mode = 0
offset_left = 46.0
offset_top = 113.0
offset_right = 109.0
offset_bottom = 144.0
text = "Submit"
[connection signal="pressed" from="ArithmeticSeq/Submit" to="." method="ArithmeticSeq"]
[connection signal="pressed" from="GeometricSeq/Submit" to="." method="GeometricSeq"]

View file

@ -0,0 +1,25 @@
[gd_scene load_steps=3 format=3 uid="uid://caqcbv4h2u0f0"]
[ext_resource type="Script" path="res://Scripts/matrix.gd" id="1_m15w6"]
[ext_resource type="PackedScene" uid="uid://cj0uj04i3vy83" path="res://Scenes/DifferentOptionsScroll.tscn" id="1_x7p7p"]
[node name="Matrix" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_m15w6")
[node name="OptionButton" parent="." instance=ExtResource("1_x7p7p")]
layout_mode = 0
anchors_preset = 0
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
offset_left = 200.0
offset_top = 760.0
offset_right = 600.0
offset_bottom = 800.0

563
Project/Scenes/shapes.tscn Normal file
View file

@ -0,0 +1,563 @@
[gd_scene load_steps=3 format=3 uid="uid://ci0w7k2nv5jm1"]
[ext_resource type="Script" path="res://Scripts/shapes.gd" id="1_gda7s"]
[ext_resource type="PackedScene" uid="uid://cj0uj04i3vy83" path="res://Scenes/DifferentOptionsScroll.tscn" id="2_o8gf1"]
[node name="Shapes" type="Control"]
layout_mode = 3
anchors_preset = 15
anchor_right = 1.0
anchor_bottom = 1.0
grow_horizontal = 2
grow_vertical = 2
script = ExtResource("1_gda7s")
[node name="Tabs" type="TabBar" parent="."]
layout_mode = 0
offset_right = 800.0
offset_bottom = 40.0
tab_alignment = 1
tab_count = 13
tab_0/title = "Triangles"
tab_1/title = "Circles"
tab_2/title = "Squares"
tab_3/title = "Rectangles"
tab_4/title = "Rhombuses"
tab_5/title = "Trapezoid"
tab_6/title = "Cones"
tab_7/title = "Spheres"
tab_8/title = "Cubes"
tab_9/title = "Parallelepipeds"
tab_10/title = "Cylinder"
tab_11/title = "Regular Polygon"
tab_12/title = "Regular Prism"
[node name="Triangles" type="Control" parent="."]
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="DLaw of Sines" type="Label" parent="Triangles"]
layout_mode = 0
offset_top = 36.0
offset_right = 164.0
offset_bottom = 62.0
text = "Law of Sines (degree)"
[node name="A" type="LineEdit" parent="Triangles/DLaw of Sines"]
layout_mode = 0
offset_top = 20.0
offset_right = 162.0
offset_bottom = 51.0
placeholder_text = "Leg a"
[node name="B" type="LineEdit" parent="Triangles/DLaw of Sines"]
layout_mode = 0
offset_top = 51.0
offset_right = 162.0
offset_bottom = 82.0
placeholder_text = "Leg b"
[node name="Beta" type="LineEdit" parent="Triangles/DLaw of Sines"]
layout_mode = 0
offset_top = 81.0
offset_right = 162.0
offset_bottom = 112.0
placeholder_text = "Angle beta"
[node name="Submit" type="Button" parent="Triangles/DLaw of Sines"]
layout_mode = 0
offset_left = 46.0
offset_top = 113.0
offset_right = 109.0
offset_bottom = 144.0
text = "Submit"
[node name="LLaw of Sines" type="Label" parent="Triangles"]
layout_mode = 0
offset_left = 163.0
offset_top = 36.0
offset_right = 297.0
offset_bottom = 62.0
text = "Law of Sines (leg)"
[node name="A" type="LineEdit" parent="Triangles/LLaw of Sines"]
layout_mode = 0
offset_top = 20.0
offset_right = 134.0
offset_bottom = 51.0
placeholder_text = "Leg a"
[node name="Alpha" type="LineEdit" parent="Triangles/LLaw of Sines"]
layout_mode = 0
offset_top = 51.0
offset_right = 134.0
offset_bottom = 82.0
placeholder_text = "Angle Alpha"
[node name="Beta" type="LineEdit" parent="Triangles/LLaw of Sines"]
layout_mode = 0
offset_top = 81.0
offset_right = 134.0
offset_bottom = 112.0
placeholder_text = "Angle Beta"
[node name="Submit" type="Button" parent="Triangles/LLaw of Sines"]
layout_mode = 0
offset_left = 33.0
offset_top = 113.0
offset_right = 96.0
offset_bottom = 144.0
text = "Submit"
[node name="Area with SSS" type="Label" parent="Triangles"]
layout_mode = 0
offset_left = 298.0
offset_top = 36.0
offset_right = 442.0
offset_bottom = 62.0
text = "Triangle Area (SSS)"
[node name="A" type="LineEdit" parent="Triangles/Area with SSS"]
layout_mode = 0
offset_top = 20.0
offset_right = 144.0
offset_bottom = 51.0
placeholder_text = "Leg a"
[node name="B" type="LineEdit" parent="Triangles/Area with SSS"]
layout_mode = 0
offset_top = 51.0
offset_right = 144.0
offset_bottom = 82.0
placeholder_text = "Leg b"
[node name="C" type="LineEdit" parent="Triangles/Area with SSS"]
layout_mode = 0
offset_top = 81.0
offset_right = 144.0
offset_bottom = 112.0
placeholder_text = "Leg c"
[node name="Submit" type="Button" parent="Triangles/Area with SSS"]
layout_mode = 0
offset_left = 39.0
offset_top = 113.0
offset_right = 102.0
offset_bottom = 144.0
text = "Submit"
[node name="Area with SAS" type="Label" parent="Triangles"]
layout_mode = 0
offset_left = 443.0
offset_top = 36.0
offset_right = 589.0
offset_bottom = 62.0
text = "Triangle Area (SAS)"
[node name="A" type="LineEdit" parent="Triangles/Area with SAS"]
layout_mode = 0
offset_top = 20.0
offset_right = 146.0
offset_bottom = 51.0
placeholder_text = "Leg a"
[node name="B" type="LineEdit" parent="Triangles/Area with SAS"]
layout_mode = 0
offset_top = 51.0
offset_right = 146.0
offset_bottom = 82.0
placeholder_text = "Leg b"
[node name="Charlie" type="LineEdit" parent="Triangles/Area with SAS"]
layout_mode = 0
offset_top = 81.0
offset_right = 146.0
offset_bottom = 112.0
placeholder_text = "Angle Charlie"
[node name="Submit" type="Button" parent="Triangles/Area with SAS"]
layout_mode = 0
offset_left = 39.0
offset_top = 113.0
offset_right = 102.0
offset_bottom = 144.0
text = "Submit"
[node name="Area of Triangle" type="Label" parent="Triangles"]
offset_left = 590.0
offset_top = 36.0
offset_right = 713.0
offset_bottom = 62.0
text = "Area of Triangle"
[node name="Base" type="LineEdit" parent="Triangles/Area of Triangle"]
layout_mode = 0
offset_top = 20.0
offset_right = 123.0
offset_bottom = 51.0
placeholder_text = "Base"
[node name="Height" type="LineEdit" parent="Triangles/Area of Triangle"]
layout_mode = 0
offset_top = 51.0
offset_right = 123.0
offset_bottom = 82.0
placeholder_text = "Height"
[node name="Submit" type="Button" parent="Triangles/Area of Triangle"]
layout_mode = 0
offset_left = 30.0
offset_top = 83.0
offset_right = 93.0
offset_bottom = 114.0
text = "Submit"
[node name="LLaw of Cosines" type="Label" parent="Triangles"]
layout_mode = 0
offset_top = 176.0
offset_right = 152.0
offset_bottom = 202.0
text = "Law of Cosines (leg)"
[node name="A" type="LineEdit" parent="Triangles/LLaw of Cosines"]
layout_mode = 0
offset_top = 20.0
offset_right = 152.0
offset_bottom = 51.0
placeholder_text = "Leg a"
[node name="B" type="LineEdit" parent="Triangles/LLaw of Cosines"]
layout_mode = 0
offset_top = 51.0
offset_right = 152.0
offset_bottom = 82.0
placeholder_text = "Leg b"
[node name="Charlie" type="LineEdit" parent="Triangles/LLaw of Cosines"]
layout_mode = 0
offset_top = 81.0
offset_right = 152.0
offset_bottom = 112.0
placeholder_text = "Angle Charlie"
[node name="Submit" type="Button" parent="Triangles/LLaw of Cosines"]
layout_mode = 0
offset_left = 46.0
offset_top = 113.0
offset_right = 109.0
offset_bottom = 144.0
text = "Submit"
[node name="DLaw of Cosines" type="Label" parent="Triangles"]
offset_left = 153.0
offset_top = 176.0
offset_right = 305.0
offset_bottom = 202.0
text = "Law of Cosines (degree)"
[node name="A" type="LineEdit" parent="Triangles/DLaw of Cosines"]
layout_mode = 0
offset_top = 20.0
offset_right = 183.0
offset_bottom = 51.0
placeholder_text = "Leg a"
[node name="B" type="LineEdit" parent="Triangles/DLaw of Cosines"]
layout_mode = 0
offset_top = 51.0
offset_right = 183.0
offset_bottom = 82.0
placeholder_text = "Leg b"
[node name="C" type="LineEdit" parent="Triangles/DLaw of Cosines"]
layout_mode = 0
offset_top = 81.0
offset_right = 183.0
offset_bottom = 112.0
placeholder_text = "Leg c"
[node name="Submit" type="Button" parent="Triangles/DLaw of Cosines"]
layout_mode = 0
offset_left = 59.0
offset_top = 113.0
offset_right = 122.0
offset_bottom = 144.0
text = "Submit"
[node name="Area of Right Triangle" type="Label" parent="Triangles"]
offset_top = 316.0
offset_right = 152.0
offset_bottom = 342.0
text = "Area of right triangle"
[node name="A" type="LineEdit" parent="Triangles/Area of Right Triangle"]
layout_mode = 0
offset_top = 20.0
offset_right = 161.0
offset_bottom = 51.0
placeholder_text = "Leg a"
[node name="B" type="LineEdit" parent="Triangles/Area of Right Triangle"]
layout_mode = 0
offset_top = 51.0
offset_right = 161.0
offset_bottom = 82.0
placeholder_text = "Leg b"
[node name="Submit" type="Button" parent="Triangles/Area of Right Triangle"]
layout_mode = 0
offset_left = 48.0
offset_top = 83.0
offset_right = 111.0
offset_bottom = 114.0
text = "Submit"
[node name="Leg of Right Triangle" type="Label" parent="Triangles"]
offset_left = 162.0
offset_top = 316.0
offset_right = 314.0
offset_bottom = 342.0
text = "Leg of right triangle"
[node name="Area" type="LineEdit" parent="Triangles/Leg of Right Triangle"]
layout_mode = 0
offset_top = 20.0
offset_right = 152.0
offset_bottom = 51.0
placeholder_text = "Area"
[node name="B" type="LineEdit" parent="Triangles/Leg of Right Triangle"]
layout_mode = 0
offset_top = 51.0
offset_right = 152.0
offset_bottom = 82.0
placeholder_text = "Leg b"
[node name="Submit" type="Button" parent="Triangles/Leg of Right Triangle"]
layout_mode = 0
offset_left = 43.0
offset_top = 83.0
offset_right = 106.0
offset_bottom = 114.0
text = "Submit"
[node name="Circles" type="Control" parent="."]
visible = false
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Area Of Circle" type="Label" parent="Circles"]
layout_mode = 0
offset_top = 36.0
offset_right = 106.0
offset_bottom = 62.0
text = "Area Of Circle"
[node name="Redius" type="LineEdit" parent="Circles/Area Of Circle"]
layout_mode = 0
offset_top = 20.0
offset_right = 106.0
offset_bottom = 51.0
placeholder_text = "Radius"
[node name="Submit" type="Button" parent="Circles/Area Of Circle"]
layout_mode = 0
offset_left = 21.0
offset_top = 52.0
offset_right = 84.0
offset_bottom = 83.0
text = "Submit"
[node name="Squares" type="Control" parent="."]
visible = false
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Area Of Square" type="Label" parent="Squares"]
layout_mode = 0
offset_top = 36.0
offset_right = 115.0
offset_bottom = 62.0
text = "Area of Square"
[node name="Side" type="LineEdit" parent="Squares/Area Of Square"]
layout_mode = 0
offset_top = 20.0
offset_right = 115.0
offset_bottom = 51.0
placeholder_text = "Side"
[node name="Submit" type="Button" parent="Squares/Area Of Square"]
layout_mode = 0
offset_left = 25.0
offset_top = 52.0
offset_right = 88.0
offset_bottom = 83.0
text = "Submit"
[node name="Rectangles" type="Control" parent="."]
visible = false
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Area Of Rectangle" type="Label" parent="Rectangles"]
layout_mode = 0
offset_top = 36.0
offset_right = 115.0
offset_bottom = 62.0
text = "Area of Rectangle"
[node name="Width" type="LineEdit" parent="Rectangles/Area Of Rectangle"]
layout_mode = 0
offset_top = 20.0
offset_right = 136.0
offset_bottom = 51.0
placeholder_text = "Width"
[node name="Height" type="LineEdit" parent="Rectangles/Area Of Rectangle"]
layout_mode = 0
offset_top = 50.0
offset_right = 136.0
offset_bottom = 81.0
placeholder_text = "Height"
[node name="Submit" type="Button" parent="Rectangles/Area Of Rectangle"]
layout_mode = 0
offset_left = 34.0
offset_top = 82.0
offset_right = 97.0
offset_bottom = 113.0
text = "Submit"
[node name="Rhombuses" type="Control" parent="."]
visible = false
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Trapezoids" type="Control" parent="."]
visible = false
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Cones" type="Control" parent="."]
visible = false
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Spheres" type="Control" parent="."]
visible = false
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Surface Area Of Sphere" type="Label" parent="Spheres"]
offset_top = 36.0
offset_right = 115.0
offset_bottom = 62.0
text = "Surface Area Sphere"
[node name="Size" type="LineEdit" parent="Spheres/Surface Area Of Sphere"]
layout_mode = 0
offset_top = 20.0
offset_right = 157.0
offset_bottom = 51.0
placeholder_text = "Radius"
[node name="Submit" type="Button" parent="Spheres/Surface Area Of Sphere"]
layout_mode = 0
offset_left = 47.0
offset_top = 52.0
offset_right = 110.0
offset_bottom = 83.0
text = "Submit"
[node name="Volume Of Sphere" type="Label" parent="Spheres"]
offset_left = 158.0
offset_top = 36.0
offset_right = 298.0
offset_bottom = 62.0
text = "Volume Of Sphere"
[node name="Size" type="LineEdit" parent="Spheres/Volume Of Sphere"]
layout_mode = 0
offset_top = 20.0
offset_right = 140.0
offset_bottom = 51.0
placeholder_text = "Radius"
[node name="Submit" type="Button" parent="Spheres/Volume Of Sphere"]
layout_mode = 0
offset_left = 41.0
offset_top = 52.0
offset_right = 104.0
offset_bottom = 83.0
text = "Submit"
[node name="Cubes" type="Control" parent="."]
visible = false
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Parallelepipeds" type="Control" parent="."]
visible = false
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Cylinder" type="Control" parent="."]
visible = false
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Regular Polygon" type="Control" parent="."]
visible = false
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="Regular Prism" type="Control" parent="."]
visible = false
layout_mode = 3
anchors_preset = 0
offset_right = 40.0
offset_bottom = 40.0
[node name="OptionButton" parent="." instance=ExtResource("2_o8gf1")]
layout_mode = 0
anchors_preset = 0
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
offset_left = 200.0
offset_top = 760.0
offset_right = 600.0
offset_bottom = 800.0
[connection signal="tab_changed" from="Tabs" to="." method="_on_tabs_tab_changed"]
[connection signal="pressed" from="Triangles/DLaw of Sines/Submit" to="." method="DLawOfSines"]
[connection signal="pressed" from="Triangles/LLaw of Sines/Submit" to="." method="LLawOfSines"]
[connection signal="pressed" from="Triangles/Area with SSS/Submit" to="." method="TriangleAreaSSS"]
[connection signal="pressed" from="Triangles/Area with SAS/Submit" to="." method="TriangleAreaSAS"]
[connection signal="pressed" from="Triangles/Area of Triangle/Submit" to="." method="TriangleBaseAndHeight"]
[connection signal="pressed" from="Triangles/LLaw of Cosines/Submit" to="." method="LLawOfCosines"]
[connection signal="pressed" from="Triangles/DLaw of Cosines/Submit" to="." method="DLawOfCosines"]
[connection signal="pressed" from="Triangles/Area of Right Triangle/Submit" to="." method="AreaOfRightTriangle"]
[connection signal="pressed" from="Triangles/Leg of Right Triangle/Submit" to="." method="LegOfRightTriangle"]
[connection signal="pressed" from="Circles/Area Of Circle/Submit" to="." method="AreaOfCircle"]
[connection signal="pressed" from="Squares/Area Of Square/Submit" to="." method="AreaOfSquare"]
[connection signal="pressed" from="Rectangles/Area Of Rectangle/Submit" to="." method="AreaOfRectangle"]
[connection signal="pressed" from="Spheres/Surface Area Of Sphere/Submit" to="." method="SurfaceAreaOfSphere"]
[connection signal="pressed" from="Spheres/Volume Of Sphere/Submit" to="." method="VolumeOfSphere"]

View file

@ -0,0 +1,74 @@
extends Control
@export var Text : LineEdit
var MathStuff = Math.new()
var Operation = ""
var Number = null
func GetKeyInput(new_text: String):
var Key = new_text.substr(len(new_text) - 1, len(new_text))
if Key == "+":
Operation_Change("Add")
Text.text = ""
elif Key == "-":
Operation_Change("Subtract")
Text.text = ""
elif Key == "*":
Operation_Change("Multiply")
Text.text = ""
elif Key == "/":
Operation_Change("Divide")
Text.text = ""
elif Key == "=":
Calculate()
elif Key == "N":
Text.text = new_text.substr(0, len(new_text) - 1) + "-"
elif Key == "C":
Scrub()
func Operation_Change(Operator : String):
if Operation != "":
Calculate()
Operation = Operator
Number = float(Text.text)
Text.text = ""
func Calculate():
match(Operation):
"Add":
Text.text = "%.10f" % (Number + float(Text.text))
"Subtract":
Text.text = "%.10f" % (Number - float(Text.text))
"Multiply":
Text.text = "%.10f" % (Number * float(Text.text))
"Divide":
Text.text = "%.10f" % (Number / float(Text.text))
"Root":
Text.text = "%.10f" % (pow(Number, 1 / float(Text.text)))
"Pow":
Text.text = "%.10f" % (pow(Number, float(Text.text)))
"Log":
Text.text = "%.10f" % (log(Number) / log(float(Text.text)))
Operation = ""
Number = null
func Instant_Calculate(FOperation: String):
match(FOperation):
"PowEuler":
Text.text = "%.10f" % (pow(MathStuff.MathConstants.e, float(Text.text)))
"RootEuler":
Text.text = "%.10f" % (log(float(Text.text)) / log(MathStuff.MathConstants.e))
"Factorial":
Text.text = "%.10f" % (float(MathStuff.Functions.FactorialWhole(int(Text.text))))
func AddNumber(thing: int):
Text.text = Text.text + str(thing)
func AddString(thing: String):
Text.text = Text.text + thing
func Scrub():
Operation = ""
Text.text = ""
Number = null

View file

@ -0,0 +1,18 @@
extends OptionButton
var BasicCalculator = "res://Scenes/calculator.tscn"
var ShapeCalculator = "res://Scenes/shapes.tscn"
var MatrixCalculator = "res://Scenes/matrix.tscn"
var OtherFunctions = "res://Scenes/functions.tscn"
func _on_item_selected(index):
var MathShitSelected = self.get_item_text(index)
match MathShitSelected:
"Basic Calculator":
get_tree().change_scene_to_file(BasicCalculator)
"Shape Calculator":
get_tree().change_scene_to_file(ShapeCalculator)
"Matrix Calculator":
get_tree().change_scene_to_file(MatrixCalculator)
"Other Functions":
get_tree().change_scene_to_file(OtherFunctions)

View file

@ -0,0 +1,23 @@
extends Control
var meat = Math.new()
func ArithmeticSeq():
var N = get_node("ArithmeticSeq/Nth")
var A1 = get_node("ArithmeticSeq/First Number")
var D = get_node("ArithmeticSeq/Common Diff")
var Result = meat.Functions.ArithmeticSequence(float(N.text), float(A1.text), float(D.text))
print(Result)
N.text = ""
A1.text = ""
D.text = ""
func GeometricSeq():
var N = get_node("GeometricSeq/Nth")
var A1 = get_node("GeometricSeq/First Number")
var R = get_node("GeometricSeq/Common Ratio")
var Result = meat.Functions.GeometricSequence(float(N.text), float(A1.text), float(R.text))
print(Result)
N.text = ""
A1.text = ""
R.text = ""

View file

@ -0,0 +1,234 @@
extends Control
class_name Math
## The Class is to contain everything relating to math.
##
## The goal of this class is to contain everything that there is to math,
## weather that be shape functions or that be other things
## Math constants in one class
##
## The math constants that are all around the math world, all in here!
## I just found a list of constants and put them in here.
class MathConstants:
const pi = 3.1415926535
const e = 2.7182818284
const δ = 4.6692016091
const FeigenbaumAlpha = 2.5029078750
const AperysConstant = 1.2020569031
const GoldenRatio = 1.6180339887
const EulerMascheroniConstant = 0.5772156649
const KhinchinsConstant = 2.6854520010
const GaussKuzminWirsingConstant = 0.3036630028
const BernsteinsConstant = 0.2801694990
const HafnerSarnakMcCurleyConstant = 0.3532363718
const MeisselMertensConstant = 0.2614972128
const GlaisherKinkelinConstnat = 1.2824271291
const Omega = 0.5671432904
const GolombDickmanConstant = 0.6243299885
const CahensConstant = 0.6434105462
const TwinPrime = 0.6601618158
const LaplaceLimit = 0.6627434193
const LandauRamanujanConstant = 0.7642236535
const CatalansConstant = 0.9159655941
const ViswanathsConstant = 1.13198824
const ConwaysConstant = 1.3035772690
const MillsConstant = 1.3063778838
const PlasticConstant = 1.3247179572
const RamanujanSoldnerConstant = 1.4513692348
const BackhouseConstant = 1.4560749485
const PortersConstant = 1.4670780794
const LiebsSquareIceConstant = 1.5396007178
const ErdosBorweinConstant = 1.6066951524
const NivensConstant = 1.7052111401
const UniversalParabolicConstant = 2.2955871493
const SierpinskisConstant = 2.5849817595
const FransenRobinsonConstant = 2.8077702420
const LevysConstant = 3.2758229187
const ReciprocalFibonacciConstant = 3.3598856662
const Googol = pow(10, 100)
const Googolplex = pow(10, Googol)
## Shape functions
##
## This bad boy has all of them shape functions!
class MathShapes:
## This here enum is used to make angle degrees easy.
enum AngleType {
RAD = 0, ## Short for Radians
DEG = 1, ## Short for Degrees
}
## This here enum is used to see what type of length the user is using.
enum CircleLengthType {
Radius = 0, ## it's just that.
Diameter = 1, ## it's radius but two times bigger.
}
# The next function are about spheres
## Get the surface area of a sphere (similar to a parameter of a circle)
static func SurfaceAreaOfSphere(Length: float, LenType: CircleLengthType = MathShapes.CircleLengthType.Radius):
if LenType == MathShapes.CircleLengthType.Radius:
return 4 * (MathConstants.pi * pow(Length, 2))
else:
return MathConstants.pi * pow(Length, 2)
## Get the volume of a sphere (similar to getting area of a circle)
static func VolumeOfSphere(Length: float, LenType: CircleLengthType = MathShapes.CircleLengthType.Radius):
if LenType == MathShapes.CircleLengthType.Radius:
return MathConstants.pi * pow(Length, 3) * 4 / 3
else:
return MathConstants.pi * pow(Length, 3) * 1 / 6
# The next functions are about circles
## Get the area of a circle using its radius.
static func AreaOfCircle(Length: float, LenType: CircleLengthType = MathShapes.CircleLengthType.Radius):
if LenType == MathShapes.CircleLengthType.Radius:
return MathConstants.pi * pow(Length, 2)
else:
return (MathConstants.pi * pow(Length, 2)) / 4
# The next functions are about squares
## Get the area of a square using its side.
static func AreaOfSquare(side: float):
return side * side
# The next functions are about rectangles
## get the area of a rectangle using its two sides
static func AreaOfRectangle(width: float, height: float):
return width * height
# The next functions are about triangles
## Get the area of a right triangle.
static func AreaOfRightTriangle(leg1: float, leg2 : float):
return (leg1 * leg2) / 2
## Get the leg of a right triangle
static func LegOfRightTriangle(leg1: float, area: float):
return 2 * (leg1 / area)
## Get the area of a triangle
static func AreaOfTriangle(base: float, height: float):
return (base * height) / 2
## Get the area of a triangle using side angle side
static func AreaOfTriangleUsingSAS(a: float, b: float, degrees: float, DegOrRad: AngleType = MathShapes.AngleType.DEG):
if DegOrRad == MathShapes.AngleType.DEG:
return a * b * sin(deg_to_rad(degrees)) / 2
else:
return a * b * sin(degrees) / 2
## Get the area of a triangle using side side side
static func AreaOfTriangleUsingSSS(a: float, b: float, c: float):
return sqrt((a + b + c) * (-a + b + c) * (a - b + c) * (a + b - c)) / 4
## Get the degrees of a triangle using law of sines
static func DegreeOfTriangleUsingLawOfSines(a: float, b: float, degreesB: float, DegOrRad: AngleType = MathShapes.AngleType.DEG):
if DegOrRad == MathShapes.AngleType.DEG:
return rad_to_deg(asin(sin(deg_to_rad(degreesB)) * a / b))
else:
return asin(sin(degreesB) * a / b)
## Get the leg of a triangle using law of sines
static func LegOfTriangleUsingLawOfSines(a: float, degreesA: float, degreesB: float, DegOrRad: AngleType = MathShapes.AngleType.DEG):
if DegOrRad == MathShapes.AngleType.DEG:
return a * (sin(deg_to_rad(degreesB)) / sin(deg_to_rad(degreesA)))
else:
return a * (sin(degreesB) / sin(degreesA))
## Get the leg length of a triangle using law of cosines.
static func LegOfTriangleUsingLawOfCosines(a: float, b: float, degrees: float, DegOrRad: AngleType = MathShapes.AngleType.DEG):
if DegOrRad == MathShapes.AngleType.DEG:
return sqrt(pow(a, 2) + pow(b, 2) - (2 * a * b * cos(deg_to_rad(degrees))))
else:
return sqrt(pow(a, 2) + pow(b, 2) - (2 * a * b * cos(degrees)))
## Get the degree of a triangle using the law of cosines (finding one angle with all the sides)
static func DegreeOfTriangleUsingLawOfCosines(a: float, b: float, c: float, DegOrRad: AngleType = MathShapes.AngleType.DEG):
if DegOrRad == MathShapes.AngleType.DEG:
return rad_to_deg(acos((pow(a, 2) + pow(b, 2) - pow(c, 2)) / (2 * a * b)))
else:
return acos((pow(a, 2) + pow(b, 2) - pow(c, 2)) / (2 * a * b))
## Matrix functions
##
## It has some functions for Math Matricies.
class Matrix:
## Adds two Matricies together [br]
## returns null if matricies aren't equal in size or it isn't a 2d array
static func AddMatricies(Matrix1: Array, Matrix2: Array):
if Matrix1[0][0] == null || Matrix2[0][0] == null || Matrix1.size() != Matrix2.size() || Matrix1[0].size() != Matrix2[0].size():
push_warning("Something messed up. returning null...")
return null
var i = 0
var Result: Array = []
while i != Matrix1.size():
Result.append(Array())
var j = 0
while j != Matrix1[0].size():
Result[i].append(Matrix1[i][j] + Matrix2[i][j])
j += 1
i += 1
return Result
## Subtracts two Matricies together [br]
## returns null if matricies aren't equal in size or it isn't a 2d array
static func SubtractMatricies(Matrix1: Array, Matrix2: Array):
if Matrix1[0][0] == null || Matrix2[0][0] == null || Matrix1.size() != Matrix2.size() || Matrix1[0].size() != Matrix2[0].size():
push_warning("Something messed up. returning null...")
return null
var i = 0
var Result: Array = []
while i != Matrix1.size():
Result.append(Array())
var j = 0
while j != Matrix1[0].size():
Result[i].append(Matrix1[i][j] - Matrix2[i][j])
j += 1
i += 1
return Result
## Multiplies a Matrix by a constant [br]
## returns null if the matrix isn't a 2d array
static func MultiplyMatrix(Matrix1: Array, Constant: float):
if Matrix1[0][0] == null:
push_warning("Something messed up. returning null...")
return null
var i = 0
var Result: Array = []
while i != Matrix1.size():
Result.append(Array())
var j = 0
while j != Matrix1[0].size():
Result[i].append(Matrix1[i][j] * Constant)
j += 1
i += 1
return Result
## Random functions
##
## If there is no other class to put the functions in, it will most likely end up here.
class Functions:
## Gets the factorial of a whole number (decimals are complex)
static func FactorialWhole(number: int):
if number >= 1000:
push_warning("Like fucking hell you are going to need a number this big. returning null...")
return null
if number != 1:
return number * FactorialWhole(number - 1)
else:
return 1
## Gets the Arithmetic Sequence's nth term
static func ArithmeticSequence(NthTerm: float, FirstTerm: float, CommonDif: float):
return FirstTerm + ((NthTerm - 1) * CommonDif)
## Gets the Geometric Sequence's nth term
static func GeometricSequence(NthTerm: float, FirstTerm: float, CommonRatio: float):
return FirstTerm * pow(CommonRatio, NthTerm - 1)

View file

@ -0,0 +1,5 @@
extends Control
# Nothing is going to go in here so far, still working on other things
func _ready():
pass

186
Project/Scripts/shapes.gd Normal file
View file

@ -0,0 +1,186 @@
extends Control
var meth = Math.new()
@onready var Triangles = get_node("Triangles")
@onready var Circles = get_node("Circles")
@onready var Squares = get_node("Squares")
@onready var Rectangles = get_node("Rectangles")
@onready var Rhombuses = get_node("Rhombuses")
@onready var Trapezoids = get_node("Trapezoids")
@onready var Cones = get_node("Cones")
@onready var Spheres = get_node("Spheres")
@onready var Cubes = get_node("Cubes")
@onready var Parellelepipeds = get_node("Parallelepipeds")
@onready var Cylinder = get_node("Cylinder")
@onready var Regular_Polygon = get_node("Regular Polygon")
@onready var Regular_Prism = get_node("Regular Prism")
func _on_tabs_tab_changed(tab):
Triangles.visible = false
Circles.visible = false
Squares.visible = false
Rectangles.visible = false
Rhombuses.visible = false
Trapezoids.visible = false
Cones.visible = false
Spheres.visible = false
Cubes.visible = false
Parellelepipeds.visible = false
Cylinder.visible = false
Regular_Polygon.visible = false
Regular_Prism.visible = false
var TheTab = get_node("Tabs").get_tab_title(tab)
match TheTab:
"Triangles":
Triangles.visible = true
"Circles":
Circles.visible = true
"Squares":
Squares.visible = true
"Rectangles":
Rectangles.visible = true
"Rhombuses":
Rhombuses.visible = true
"Trapezoids":
Trapezoids.visible = true
"Cones":
Cones.visible = true
"Spheres":
Spheres.visible = true
"Cubes":
Cubes.visible = true
"Parellelepipeds":
Parellelepipeds.visible = true
"Cylinder":
Cylinder.visible = true
"Regular Polygon":
Regular_Polygon.visible = true
"Regular Prism":
Regular_Prism.visible = true
# The next functions are about triangles
func DLawOfSines():
var A = Triangles.get_node("DLaw of Sines/A")
var B = Triangles.get_node("DLaw of Sines/B")
var Beta = Triangles.get_node("DLaw of Sines/Beta")
var Results = meth.MathShapes.DegreeOfTriangleUsingLawOfSines(float(A.text), float(B.text), float(Beta.text))
print(Results)
A.text = ""
B.text = ""
Beta.text = ""
func LLawOfSines():
var A = Triangles.get_node("LLaw of Sines/A")
var Alpha = Triangles.get_node("LLaw of Sines/Alpha")
var Beta = Triangles.get_node("LLaw of Sines/Beta")
var Results = meth.MathShapes.LegOfTriangleUsingLawOfSines(float(A.text), float(Alpha.text), float(Beta.text))
print(Results)
A.text = ""
Alpha.text = ""
Beta.text = ""
func TriangleAreaSSS():
var A = Triangles.get_node("Area with SSS/A")
var B = Triangles.get_node("Area with SSS/B")
var C = Triangles.get_node("Area with SSS/C")
var Results = meth.MathShapes.AreaOfTriangleUsingSSS(float(A.text), float(B.text), float(C.text))
print(Results)
A.text = ""
B.text = ""
C.text = ""
func TriangleAreaSAS():
var A = Triangles.get_node("Area with SAS/A")
var B = Triangles.get_node("Area with SAS/B")
var Charlie = Triangles.get_node("Area with SAS/Charlie")
var Results = meth.MathShapes.AreaOfTriangleUsingSAS(float(A.text), float(B.text), float(Charlie.text))
print(Results)
A.text = ""
B.text = ""
Charlie.text = ""
func LLawOfCosines():
var A = Triangles.get_node("LLaw of Cosines/A")
var B = Triangles.get_node("LLaw of Cosines/B")
var Charlie = Triangles.get_node("LLaw of Cosines/Charlie")
var Results = meth.MathShapes.LegOfTriangleUsingLawOfCosines(float(A.text), float(B.text), float(Charlie.text))
print(Results)
A.text = ""
B.text = ""
Charlie.text = ""
func DLawOfCosines():
var A = Triangles.get_node("DLaw of Cosines/A")
var B = Triangles.get_node("DLaw of Cosines/B")
var C = Triangles.get_node("DLaw of Cosines/C")
var Results = meth.MathShapes.DegreeOfTriangleUsingLawOfCosines(float(A.text), float(B.text), float(C.text))
print(Results)
A.text = ""
B.text = ""
C.text = ""
func AreaOfRightTriangle():
var A = Triangles.get_node("Area of Right Triangle/A")
var B = Triangles.get_node("Area of Right Triangle/B")
var Results = meth.MathShapes.AreaOfRightTriangle(float(A.text), float(B.text))
print(Results)
A.text = ""
B.text = ""
func LegOfRightTriangle():
var Area = Triangles.get_node("Leg of Right Triangle/Area")
var B = Triangles.get_node("Leg of Right Triangle/B")
var Results = meth.MathShapes.LegOfRightTriangle(float(B.text), float(Area.text))
print(Results)
Area.text = ""
B.text = ""
func TriangleBaseAndHeight():
var Base = Triangles.get_node("Area of Triangle/Base")
var Height = Triangles.get_node("Area of Triangle/Height")
var Results = meth.MathShapes.AreaOfTriangle(float(Base.text), float(Height.text))
print(Results)
Base.text = ""
Height.text = ""
# The next functions are about circles
func AreaOfCircle():
var Radius = Circles.get_node("Circles/Area Of Circle/Redius")
var Results = meth.MathShapes.AreaOfCircle(float(Radius.text))
print(Results)
Radius.text = ""
# The next functions are about square
func AreaOfSquare():
var Side = Squares.get_node("Squares/Area Of Square/Side")
var Results = meth.MathShapes.AreaOfSquare(float(Side.text))
print(Results)
Side.text = ""
# The next functions are about rectangle
func AreaOfRectangle():
var Width = Rectangles.get_node("Rectangles/Area Of Rectangle/Width")
var Height = Rectangles.get_node("Rectangles/Area Of Rectangle/Height")
var Results = meth.MathShapes.AreaOfRectangle(float(Width.text), float(Height.text))
print(Results)
Width.text = ""
Height.text = ""
# The next functions are about spheres
func SurfaceAreaOfSphere():
var Radius = Spheres.get_node("Surface Area Of Sphere/Size")
var Results = meth.MathShapes.SurfaceAreaOfSphere(float(Radius.text))
print(Results)
Radius.text = ""
func VolumeOfSphere():
var Radius = Spheres.get_node("Volume Of Sphere/Size")
var Results = meth.MathShapes.VolumeOfSphere(float(Radius.text))
print(Results)
Radius.text = ""

View file

@ -0,0 +1,11 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://blrv60yt0gbld"]
[resource]
bg_color = Color(0.392157, 0.0431373, 0, 1)
draw_center = false
border_width_left = 4
border_width_top = 4
border_width_right = 4
border_width_bottom = 4
border_color = Color(0, 0, 0, 1)
border_blend = true

View file

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://cqpag6x74x8wv"]
[resource]
bg_color = Color(0.560784, 0.0784314, 0, 1)

View file

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://bakatxtwoh52x"]
[resource]
bg_color = Color(0.819608, 1, 0.266667, 1)

View file

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://bh5m8n5nsrrs4"]
[resource]
bg_color = Color(0.290196, 0.431373, 0.913725, 1)

View file

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://bgd3kkjp56k6t"]
[resource]
bg_color = Color(0.392157, 0.0431373, 0, 1)

View file

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://bfnnrhuw8yyar"]
[resource]
bg_color = Color(0.709804, 0.8, 0.266667, 1)

View file

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://dx4v7hg5h47sm"]
[resource]
bg_color = Color(0, 0, 0.913725, 1)

View file

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://b76lg563f17a1"]
[resource]
bg_color = Color(0.717647, 0.113725, 0, 1)

View file

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://263e7dk41d7p"]
[resource]
bg_color = Color(1, 1, 0, 1)

View file

@ -0,0 +1,4 @@
[gd_resource type="StyleBoxFlat" format=3 uid="uid://cd8st43btla0m"]
[resource]
bg_color = Color(0.290196, 0.690196, 0.913725, 1)

1
Project/icon.svg Normal file
View file

@ -0,0 +1 @@
<svg height="128" width="128" xmlns="http://www.w3.org/2000/svg"><g transform="translate(32 32)"><path d="m-16-32c-8.86 0-16 7.13-16 15.99v95.98c0 8.86 7.13 15.99 16 15.99h96c8.86 0 16-7.13 16-15.99v-95.98c0-8.85-7.14-15.99-16-15.99z" fill="#363d52"/><path d="m-16-32c-8.86 0-16 7.13-16 15.99v95.98c0 8.86 7.13 15.99 16 15.99h96c8.86 0 16-7.13 16-15.99v-95.98c0-8.85-7.14-15.99-16-15.99zm0 4h96c6.64 0 12 5.35 12 11.99v95.98c0 6.64-5.35 11.99-12 11.99h-96c-6.64 0-12-5.35-12-11.99v-95.98c0-6.64 5.36-11.99 12-11.99z" fill-opacity=".4"/></g><g stroke-width="9.92746" transform="matrix(.10073078 0 0 .10073078 12.425923 2.256365)"><path d="m0 0s-.325 1.994-.515 1.976l-36.182-3.491c-2.879-.278-5.115-2.574-5.317-5.459l-.994-14.247-27.992-1.997-1.904 12.912c-.424 2.872-2.932 5.037-5.835 5.037h-38.188c-2.902 0-5.41-2.165-5.834-5.037l-1.905-12.912-27.992 1.997-.994 14.247c-.202 2.886-2.438 5.182-5.317 5.46l-36.2 3.49c-.187.018-.324-1.978-.511-1.978l-.049-7.83 30.658-4.944 1.004-14.374c.203-2.91 2.551-5.263 5.463-5.472l38.551-2.75c.146-.01.29-.016.434-.016 2.897 0 5.401 2.166 5.825 5.038l1.959 13.286h28.005l1.959-13.286c.423-2.871 2.93-5.037 5.831-5.037.142 0 .284.005.423.015l38.556 2.75c2.911.209 5.26 2.562 5.463 5.472l1.003 14.374 30.645 4.966z" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 919.24059 771.67186)"/><path d="m0 0v-47.514-6.035-5.492c.108-.001.216-.005.323-.015l36.196-3.49c1.896-.183 3.382-1.709 3.514-3.609l1.116-15.978 31.574-2.253 2.175 14.747c.282 1.912 1.922 3.329 3.856 3.329h38.188c1.933 0 3.573-1.417 3.855-3.329l2.175-14.747 31.575 2.253 1.115 15.978c.133 1.9 1.618 3.425 3.514 3.609l36.182 3.49c.107.01.214.014.322.015v4.711l.015.005v54.325c5.09692 6.4164715 9.92323 13.494208 13.621 19.449-5.651 9.62-12.575 18.217-19.976 26.182-6.864-3.455-13.531-7.369-19.828-11.534-3.151 3.132-6.7 5.694-10.186 8.372-3.425 2.751-7.285 4.768-10.946 7.118 1.09 8.117 1.629 16.108 1.846 24.448-9.446 4.754-19.519 7.906-29.708 10.17-4.068-6.837-7.788-14.241-11.028-21.479-3.842.642-7.702.88-11.567.926v.006c-.027 0-.052-.006-.075-.006-.024 0-.049.006-.073.006v-.006c-3.872-.046-7.729-.284-11.572-.926-3.238 7.238-6.956 14.642-11.03 21.479-10.184-2.264-20.258-5.416-29.703-10.17.216-8.34.755-16.331 1.848-24.448-3.668-2.35-7.523-4.367-10.949-7.118-3.481-2.678-7.036-5.24-10.188-8.372-6.297 4.165-12.962 8.079-19.828 11.534-7.401-7.965-14.321-16.562-19.974-26.182 4.4426579-6.973692 9.2079702-13.9828876 13.621-19.449z" fill="#478cbf" transform="matrix(4.162611 0 0 -4.162611 104.69892 525.90697)"/><path d="m0 0-1.121-16.063c-.135-1.936-1.675-3.477-3.611-3.616l-38.555-2.751c-.094-.007-.188-.01-.281-.01-1.916 0-3.569 1.406-3.852 3.33l-2.211 14.994h-31.459l-2.211-14.994c-.297-2.018-2.101-3.469-4.133-3.32l-38.555 2.751c-1.936.139-3.476 1.68-3.611 3.616l-1.121 16.063-32.547 3.138c.015-3.498.06-7.33.06-8.093 0-34.374 43.605-50.896 97.781-51.086h.066.067c54.176.19 97.766 16.712 97.766 51.086 0 .777.047 4.593.063 8.093z" fill="#478cbf" transform="matrix(4.162611 0 0 -4.162611 784.07144 817.24284)"/><path d="m0 0c0-12.052-9.765-21.815-21.813-21.815-12.042 0-21.81 9.763-21.81 21.815 0 12.044 9.768 21.802 21.81 21.802 12.048 0 21.813-9.758 21.813-21.802" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 389.21484 625.67104)"/><path d="m0 0c0-7.994-6.479-14.473-14.479-14.473-7.996 0-14.479 6.479-14.479 14.473s6.483 14.479 14.479 14.479c8 0 14.479-6.485 14.479-14.479" fill="#414042" transform="matrix(4.162611 0 0 -4.162611 367.36686 631.05679)"/><path d="m0 0c-3.878 0-7.021 2.858-7.021 6.381v20.081c0 3.52 3.143 6.381 7.021 6.381s7.028-2.861 7.028-6.381v-20.081c0-3.523-3.15-6.381-7.028-6.381" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 511.99336 724.73954)"/><path d="m0 0c0-12.052 9.765-21.815 21.815-21.815 12.041 0 21.808 9.763 21.808 21.815 0 12.044-9.767 21.802-21.808 21.802-12.05 0-21.815-9.758-21.815-21.802" fill="#fff" transform="matrix(4.162611 0 0 -4.162611 634.78706 625.67104)"/><path d="m0 0c0-7.994 6.477-14.473 14.471-14.473 8.002 0 14.479 6.479 14.479 14.473s-6.477 14.479-14.479 14.479c-7.994 0-14.471-6.485-14.471-14.479" fill="#414042" transform="matrix(4.162611 0 0 -4.162611 656.64056 631.05679)"/></g></svg>

After

Width:  |  Height:  |  Size: 4.1 KiB

37
Project/icon.svg.import Normal file
View file

@ -0,0 +1,37 @@
[remap]
importer="texture"
type="CompressedTexture2D"
uid="uid://bcafdnbbyxrqx"
path="res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"
metadata={
"vram_texture": false
}
[deps]
source_file="res://icon.svg"
dest_files=["res://.godot/imported/icon.svg-218a8f2b3041327d8a5756f3a245f83b.ctex"]
[params]
compress/mode=0
compress/high_quality=false
compress/lossy_quality=0.7
compress/hdr_compression=1
compress/normal_map=0
compress/channel_pack=0
mipmaps/generate=false
mipmaps/limit=-1
roughness/mode=0
roughness/src_normal=""
process/fix_alpha_border=true
process/premult_alpha=false
process/normal_map_invert_y=false
process/hdr_as_srgb=false
process/hdr_clamp_exposure=false
process/size_limit=0
detect_3d/compress_to=1
svg/scale=1.0
editor/scale_with_editor_scale=false
editor/convert_colors_with_editor_theme=false

25
Project/project.godot Normal file
View file

@ -0,0 +1,25 @@
; Engine configuration file.
; It's best edited using the editor UI and not directly,
; since the parameters that go here are not all obvious.
;
; Format:
; [section] ; section goes between []
; param=value ; assign values to parameters
config_version=5
[application]
config/name="Galculator"
run/main_scene="res://Scenes/calculator.tscn"
config/features=PackedStringArray("4.2", "Forward Plus")
config/icon="res://icon.svg"
[display]
window/size/viewport_width=800
window/size/viewport_height=800
[filesystem]
import/blender/enabled=false

3
README.md Normal file
View file

@ -0,0 +1,3 @@
# Galculator
A calculator made in the Godot Engine. Also has a math library built in.