capacitor: Draw a capacitor

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Draw a capacitor

Usage

1
2
3
4
5
capacitor(x0, y0, x1, y1,
          points=FALSE,
          length=0.01, width=length*5,  
          label, pos,
          col=par('col'), lwd=par('lwd'), cex=par('cex'))

Arguments

x0,y0

starting coordinate of element

x1,y1

ending coordinate of element

points

booline indicating whether to draw dots at the ends of the wire

length

distance between capactor plates

width

length of plates

label

optional string placed near component (see pos)

pos

optional position of label, as for par(pos); defaults to 1 if horizontal=TRUE, or 2 otherwise.

col

colour

lwd

line width

cex

size of points (ignored unless points is TRUE)

Details

The coordinate system has both x and y ranging from 0 to 1.

Value

Vector containing x0, y0, x1, y1.

Author(s)

Dan Kelley

See Also

The plot must first be set up with circuit.

Examples

1
2
3
4
5
6
library(circuit)
circuit()
resistor(0.1, 0.5, 0.1, 0.8, label="10k")
capacitor(0.4, 0.2, 0.4, 0.5, label='10uF')
wire(0.4, 0.5, 0.7, 0.5)
ground(0.4, 0.2)

dankelley/circuit documentation built on May 14, 2019, 4:09 p.m.