Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Sine approximation
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Clojure
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Rust
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
#R version 3.3.2 x <- 1:500 x <- pi * (x - min(x)) / (max(x) - min(x)) y <- 1.27323954 * x - 0.405284735 * x^2 z <- sin(x) y <- rep(c(y, -y), time = 2) z <- rep(c(z, -z), time = 2) plot(y, type = "l", col = "red", lwd = 2) lines(z, col = "blue", lwd = 2) legend("bottomleft", legend = c("Approximated sine", "Real sine"), col = c("red", "blue"), pch = c(20, 20))
[
+
]
Show input
Absolute running time: 0.7 sec, cpu time: 0.77 sec, memory peak: 32 Mb, absolute service time: 0,72 sec
edit mode
|
history
|
discussion