From 7b2bb16a046558f142d7438556fbf322010f8ab2 Mon Sep 17 00:00:00 2001 From: 30secondsofcode <30secondsofcode@gmail.com> Date: Tue, 15 Oct 2019 12:18:50 +0000 Subject: [PATCH] Travis build: 163 --- README.md | 24 ++++++++++++++++++++++++ snippet_data/snippetList.json | 15 +++++++++++++++ snippet_data/snippets.json | 20 ++++++++++++++++++++ 3 files changed, 59 insertions(+) diff --git a/README.md b/README.md index 89cf6cc0c..1a11b9aa7 100644 --- a/README.md +++ b/README.md @@ -81,6 +81,7 @@ * [`average`](#average) * [`average_by`](#average_by) * [`clamp_number`](#clamp_number) +* [`degrees_to_rads`](#degrees_to_rads) * [`digitize`](#digitize) * [`factorial`](#factorial) * [`fibonacci`](#fibonacci) @@ -1269,6 +1270,29 @@ clamp_number(1, -1, -5) # -1
[⬆ Back to top](#contents) +### degrees_to_rads + +Converts an angle from degrees to radians. + +Use `math.pi` and the degrees to radians formula to convert the angle from degrees to radians. + +```py +import math + +def degrees_to_rads(deg): + return (deg * math.pi) / 180.0 +``` + +
+Examples + +```py +degrees_to_rads(180) # 3.141592653589793 +``` +
+ +
[⬆ Back to top](#contents) + ### digitize Converts a number to an array of digits. diff --git a/snippet_data/snippetList.json b/snippet_data/snippetList.json index 43ce32d0e..5c474295b 100644 --- a/snippet_data/snippetList.json +++ b/snippet_data/snippetList.json @@ -277,6 +277,21 @@ "hash": "a100d5704afe48a7dce26871bc50c993670d7388d8e4958c02c07efe07884167" } }, + { + "id": "degrees_to_rads", + "type": "snippetListing", + "title": "degrees_to_rads", + "attributes": { + "text": "Converts an angle from degrees to radians.\n\nUse `math.pi` and the degrees to radians formula to convert the angle from degrees to radians.\n\n", + "tags": [ + "math", + "beginner" + ] + }, + "meta": { + "hash": "8bb6f1b7cde2b4602449ee30a7c7e402d25e6bb6a7841472d87b7fcbe5eab7f3" + } + }, { "id": "difference", "type": "snippetListing", diff --git a/snippet_data/snippets.json b/snippet_data/snippets.json index bde40535e..43bca1761 100644 --- a/snippet_data/snippets.json +++ b/snippet_data/snippets.json @@ -367,6 +367,26 @@ "hash": "a100d5704afe48a7dce26871bc50c993670d7388d8e4958c02c07efe07884167" } }, + { + "id": "degrees_to_rads", + "title": "degrees_to_rads", + "type": "snippet", + "attributes": { + "fileName": "degrees_to_rads.md", + "text": "Converts an angle from degrees to radians.\n\nUse `math.pi` and the degrees to radians formula to convert the angle from degrees to radians.\n\n", + "codeBlocks": { + "code": "import math\n\ndef degrees_to_rads(deg):\n return (deg * math.pi) / 180.0", + "example": "degrees_to_rads(180) # 3.141592653589793" + }, + "tags": [ + "math", + "beginner" + ] + }, + "meta": { + "hash": "8bb6f1b7cde2b4602449ee30a7c7e402d25e6bb6a7841472d87b7fcbe5eab7f3" + } + }, { "id": "difference", "title": "difference",