6 kyu
The Walker
325 of 1,145g964
Description:
The walker
The walker starts from point O, walks along OA, AB and BC. When he is in C (C will be in the upper half-plane), what is the distance CO
? What is the angle tOC
in positive degrees, minutes, seconds?
Angle tOA
is alpha
(here 45 degrees), angle hAB
is beta
(here 30 degrees), angle uBC
is gamma
(here 60 degrees).
Task
function solve(a, b, c, alpha, beta, gamma)
with parameters
- a, b, c: positive integers in units of distance (stand for OA, AB, BC)
- alpha, beta, gamma: positive integers in degrees (positive angles are anticlockwise)
returns an array:
- first element: distance CO (rounded to the nearest integer)
- then angle tOC with the third following elements:
- second element of the array: number of degrees in angle tOC (truncated positive integer)
- third element of the array: number of minutes in angle tOC (truncated positive integer)
- fourth element of the array: number of seconds in angle tOC (truncated positive integer)
Example:
print(solve(12, 20, 18, 45, 30, 60)) -> [15, 135, 49, 18]
- CO is 14.661... rounded to 15
- angle tOC is 135.821...
so
- degrees = 135
- minutes = 49.308...
- seconds = 18.518...
hence [15, 135, 49, 18]
Note
If you need the constant pi
you can use pi = 3.14159265358979323846
Fundamentals
Geometry
Stats:
Created | Jul 7, 2018 |
Published | Jul 7, 2018 |
Warriors Trained | 7248 |
Total Skips | 901 |
Total Code Submissions | 4826 |
Total Times Completed | 1145 |
Python Completions | 325 |
JavaScript Completions | 160 |
Java Completions | 117 |
Ruby Completions | 22 |
C# Completions | 89 |
C Completions | 74 |
C++ Completions | 109 |
Clojure Completions | 7 |
R Completions | 17 |
F# Completions | 10 |
PHP Completions | 16 |
Kotlin Completions | 26 |
Groovy Completions | 8 |
CoffeeScript Completions | 8 |
Lua Completions | 37 |
Go Completions | 36 |
Rust Completions | 47 |
Nim Completions | 5 |
Crystal Completions | 4 |
Swift Completions | 25 |
Elixir Completions | 8 |
Scala Completions | 22 |
Fortran Completions | 7 |
Julia Completions | 10 |
PowerShell Completions | 12 |
OCaml Completions | 11 |
Haskell Completions | 16 |
Reason Completions | 5 |
Racket Completions | 6 |
TypeScript Completions | 31 |
VB Completions | 12 |
Haxe Completions | 3 |
Dart Completions | 23 |
Pascal Completions | 4 |
Perl Completions | 5 |
Raku Completions | 3 |
Elm Completions | 5 |
D Completions | 6 |
Erlang Completions | 4 |
Prolog Completions | 6 |
Total Stars | 183 |
% of votes with a positive feedback rating | 86% of 229 |
Total "Very Satisfied" Votes | 180 |
Total "Somewhat Satisfied" Votes | 35 |
Total "Not Satisfied" Votes | 14 |
Total Rank Assessments | 9 |
Average Assessed Rank | 6 kyu |
Highest Assessed Rank | 4 kyu |
Lowest Assessed Rank | 7 kyu |