# potenza in sinusoidale f0 = 12 # V R = 50 # Ohm nu =1000 # Hz om = 2*pi*nu T = 1/nu tofile = TRUE f.name = "potenza_sinusoidale_C.png" if(tofile) png(file=f.name, width = 960, height = 480, units = "px", pointsize = 12) old.mar = par("mar") par(mar=c(3.9,4.0,0.1,0.1)) # margini ottimizzati curve(cos(om*x*T), -0.5, 1.5, xlab='t / T', ylab='f(t)/f0; P(t)/Pmax', lwd=3, col='blue') abline(h=0) grid() curve(cos(om*x*T+pi/2), lwd=3, col='green', add=TRUE) curve(-sin(2*om*x*T), lwd=3, col='red', n=201, add=TRUE) abline(h=0, lty=2, col=2) par(mar=old.mar) if(tofile) dev.off()