This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
title: "A graphics workflow" | |
author: "baptiste" | |
date: 2018-20-05 | |
--- | |
Glyphs are positioned by x and y coordinates; other parameters are kept separate as they may differ from glyph to glyph and, crucially, compound glyphs contain nested glyphs with their own properties, requiring a flexible container. | |
The structure of a glyph is thus as follows, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# library(cubs) | |
library(Ryacas) | |
Ylm <- function(l,m,phi,theta){ | |
ex <- Ryacas::yac_expr(glue::glue("(-1)^{m}*(1-x^2)^({m}/2)*D(x,{m})OrthoP({l}, x)")) | |
sqrt((2*l+1)/(4*pi) * factorial(l-m) / factorial(l+m))* | |
exp(1i*abs(m)*phi) * eval(ex, list(x = cos(theta))) | |
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(vwline) | |
library(gridGeometry) | |
library(hershey) | |
library(ggplot2) | |
library(scales) | |
w <- c(0, .2, 0) | |
gl <- list() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(gridExtra) | |
library(grid) | |
N <- 15 | |
N2 <- 8 | |
d <- matrix(sample(seq(1,N2,by=2)^2, N^2,replace = T),N,N) | |
myfun <- function(label, ...){ | |
i <- as.numeric(label) | |
n <- sqrt(i) | |
arrangeGrob(grobs=replicate(i, rectGrob(gp=gpar(fill=grey(runif(1,0.5+0.2*n/N2,0.9-0.2*n/N2)),col='white', lwd=1)), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
library(chipmunkbasic) | |
library(chipmunkcore) | |
library(ggplot2) | |
N <- 2 | |
cm <- Chipmunk$new(time_step = 0.005) | |
cm$add_static_segment(-70, 0, 120, 0, friction = 0, elasticity = 1) | |
cm$add_static_segment(-70, 0, -70, 30, friction = 0, elasticity = 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## visualising some spherical harmonics on a sphere | |
## with 3d interactive plot | |
## Ylm is a scalar field defined at surface points | |
## E is a vector field defined at those points | |
library(rgl) | |
library(dplyr) | |
library(RColorBrewer) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
m <- matrix(c(0,1), nrow = 600, ncol=800) | |
lm <- replicate(100, jitter(m, 20), simplify = FALSE) | |
library(Cairo) | |
CairoX11() | |
plot.new() | |
system.time({ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.