Skip to content

Instantly share code, notes, and snippets.

@dinob0t
dinob0t / valentinesDay.m
Last active August 29, 2015 13:56
A Valentine's Day inspired function to plot concentric rainbow love hearts.
function valentinesDay(figureHandle, heartNumber)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Win the affections of any geek on Valentine's Day with this MATLAB %
% script to generate and plot a set of concentric rainbow love hearts. %
% %
% INPUT %
% figureHandle : A handle to the figure in which the plotting is to be %
% done %
% heartNumber: The number of colour steps and hearts to plot (~100 %
% looks nice) %
@dinob0t
dinob0t / cracklePop.m
Created February 18, 2014 10:26
A faster CracklePop code
clear all
clc
fasterTic = tic;
crackleString = 'Crackle';
popString = 'Pop';
cracklePopString = 'CracklePop';
numberArray = (1:n);
stringArrayColSize = max([length(n) length(crackleString) ...
@dinob0t
dinob0t / points_on_sphere
Last active February 24, 2023 16:37
Generates evenly distributed points on the surface of a sphere
"""
To generate 'num' points on a sphere of radius 'r' centred on the origin
- Random placement involves randomly chosen points for 'z' and 'phi'
- Regular placement involves chosing points such that there one point per d_area
References:
Deserno, 2004, How to generate equidistributed points on the surface of a sphere
http://www.cmu.edu/biolphys/deserno/pdf/sphere_equi.pdf
"""
<!DOCTYPE html>
<meta charset="utf-8">
<style>
#boroughs {
stroke: grey;
stroke-width: 2px;
fill: steelblue;
}
</style>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.