Skip to content

CapacitorNode

Overview

Visual representation of a capacitor with a vacuum gap.

@author Chris Malley (PixelZoom, Inc.) @author Jesse Greenberg (PhET Interactive Simulations) @author Andrew Adare (PhET Interactive Simulations)

Class CapacitorNode

import { CapacitorNode } from 'scenerystack/scenery-phet';

Constructor

new CapacitorNode( circuit, modelViewTransform, plateChargeVisibleProperty, electricFieldVisibleProperty, options )

Instance Methods

dispose()

@public

frontSideContainsSensorPoint( globalPoint )

Returns true if the front side contains the specified point, used for voltmeter probe hit testing. @param {Vector2} globalPoint @returns {boolean} @public

backSideContainsSensorPoint( globalPoint )

Returns true if the back side contains the specified point, used for voltmeter probe hit testing. @param {Vector2} globalPoint @returns {boolean} @public

getTopPlateClipShapeToGlobal()

Returns the clipping region for the top shape, in global coordinates, used to show wires or electrons flowing in/out of the capacitor. @returns {Shape} @public

getBottomPlateClipShapeToGlobal()

Returns the clipping region for the bottom shape, in global coordinates, used to show wires or electrons flowing in/out of the capacitor. @returns {Shape} @public

updateGeometry()

Update the geometry of the capacitor plates. @private

getPlatesBounds()

Get the bound of the capacitor from the plates. Allows for bounds to be passed into the canvas node before the children are added to the view. @public

@returns {Bounds2}

Source Code

See the source for CapacitorNode.js in the scenery-phet repository.