Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
solve_xkcd135b <- function(h=0.001) { # start positions start_rtop <- c(0, sqrt(20^2-10^2)) start_rright <- c(10, 0) start_rleft <- c(-10,0) start_me <- c(0, sqrt(3)/6*20) # survival time, given angle phi and stepsize h pos_me <- function(t, phi) start_me + c(sin(phi)*6*t, cos(phi)*6*t) velo_rtop <- function(t) pmin(4*t, 10) # wounded top raptor velo_rapt <- function(t) pmin(4*t, 25) # left & right dist_rapt <- function(from, to, velo) integrate(velo, from, to)$value surv_time <- function(phi, h, pos0, velo) { curr <- pos0 t <- 0 repeat { t <- t + h old <- curr direction <- c(pos_me(t-h, phi)-old) len <- dist_rapt(t-h, t, velo) if(dist(rbind(pos_me(t, phi), old))
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)