- No conflicts
- No warnings
- Builds
- Tests passing
// Twitter: @fewlinesofcode | |
var angle = 1.0; | |
var angularSpeed = 0.01; | |
var internalRadius = 130; | |
function setup() { | |
createCanvas(600, 600); | |
noStroke(); | |
background(255); |
const w = 500; | |
const h = 500; | |
const numWalkers = 1000; | |
let walkers = []; | |
function setup() { | |
createCanvas(w, h); | |
background(255); | |
const s = (p) => { | |
const w = 400; | |
const h = 400; | |
// Center coordinates | |
const x0 = 200; | |
const y0 = 200; | |
// Radius | |
const r = 150; |
import UIKit | |
extension UIBezierPath { | |
private static func addCorner( | |
_ path: UIBezierPath, | |
p1: CGPoint, | |
p: CGPoint, | |
p2: CGPoint, | |
radius: CGFloat, | |
isStart: Bool = false |
import UIKit | |
extension UIBezierPath { | |
private static func midpoint(_ a: CGPoint, b: CGPoint) -> CGPoint { | |
CGPoint( | |
x: (b.x + a.x) / 2, | |
y: (b.y + a.y) / 2 | |
) | |
} | |
let dcf = DateComponentsFormatter() | |
dcf.unitsStyle = .abbreviated | |
dcf.includesApproximationPhrase = false | |
dcf.includesTimeRemainingPhrase = true | |
dcf.allowedUnits = [.day, .hour, .minute, .second] | |
let past = Date().advanced(by: -10) | |
let now = Date() | |
let humanReadableString = dcf.string(from: past, to: now) | |
print(humanReadableString!) |
// | |
// main.swift | |
// Beachline | |
// | |
// Created by Oleksandr Glagoliev on 1/4/20. | |
// Copyright © 2020 Oleksandr Glagoliev. All rights reserved. | |
// | |
import Foundation |
import Foundation | |
public func cross(_ o: CGPoint, _ a: CGPoint, _ b: CGPoint) -> CGFloat { | |
let lhs = (a.x - o.x) * (b.y - o.y) | |
let rhs = (a.y - o.y) * (b.x - o.x) | |
return lhs - rhs | |
} | |
/// Calculate and return the convex hull of a given sequence of points. | |
/// |
import math | |
def to_deg(angle): | |
return angle * (180 / math.pi) | |
def to_rad(angle): | |
return angle * (math.pi / 180) | |
# Environment | |
airDensity = 1.2234 # kg/m^3 |