# Class Vibration

java.lang.Object
javajs.util.T3
javajs.util.V3
org.jmol.util.Vibration

All Implemented Interfaces:
  `Serializable, JSONEncodable`

Direct Known Subclasses:
  `ModulationSet`

public class Vibration extends V3
A class to allow for more complex vibrations and associated phenomena, such as modulated crystals. In the case of modulations, ModulationSet extends Vibration and is implemented that way, and, as well, magnetic spin is also a form of Vibration that may have an associated ModulationSet, as indicated here

Author:
  Bob Hanson hansonr@stolaf.edu
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`boolean`
`isFractional`
`boolean`
`isFrom000`
`float`
`magMoment`
`int`
`modDim`
modDim will be > 0 for modulation
`float`
`modScale`
`boolean`
`showTrace`
`String`
`symmform`
`int`
`tracePt`
`protected static final double`
`twoPI`
`static final int`
`TYPE_SPIN`
`static final int`
`TYPE_VIBRATION`
`static final int`
`TYPE_WYCKOFF`
`V3`
`v0`

### Fields inherited from class T3

`x, y, z`

## Constructor Summary

Constructors
Constructor
Description
`Vibration()`

## Method Summary

Modifier and Type
Method
Description
`P3[]`
`addTracePt(int n, Point3fi ptNew)`
`Object`
`clone()`
`static Atom`
`find(ModelSet modelSet, BS bs, Vibration v0)`
`String`
`getApproxString100()`
`void`
`getInfo(Map<String,Object> info)`
`int`
`getOccupancy100(boolean isTemp)`
`boolean`
`isNonzero()`
`int`
`rotateModelSpinVectors(ModelSet ms, int modelIndex, M3 rot, boolean isdx)`
`void`
`rotateSpin(M3 matInv, M3 rot, M3 dRot, Atom a)`
`T3`
`setCalcPoint(T3 pt, T3 t456, float scale, float modulationScale)`
`Vibration`
`setType(int type)`
`void`
`setV0()`
`void`
`setXYZ(T3 vib)`
`void`
`startTrace(int n)`

### Methods inherited from class V3

`angle, new3, newV, newVsub`

### Methods inherited from class T3

`add, add2, add3, ave, cross, distance, distanceSquared, dot, equals, floatToIntBits, hashCode, length, lengthSquared, normalize, putP, scale, scaleAdd2, scaleT, set, setA, setP, setT, sub, sub2, toJSON, toString`

### Methods inherited from class Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

## Field Details

### twoPI

protected static final double twoPI

See Also:
  - Constant Field Values

### TYPE_VIBRATION

public static final int TYPE_VIBRATION

See Also:
  - Constant Field Values

### TYPE_SPIN

public static final int TYPE_SPIN

See Also:
  - Constant Field Values

### TYPE_WYCKOFF

public static final int TYPE_WYCKOFF

See Also:
  - Constant Field Values

### modDim

public int modDim
modDim will be > 0 for modulation

### modScale

public float modScale

### magMoment

public float magMoment

### showTrace

public boolean showTrace

### isFractional

public boolean isFractional

### v0

public V3 v0

### tracePt

public int tracePt

### symmform

public String symmform

### isFrom000

public boolean isFrom000

## Constructor Details

### Vibration

public Vibration()

## Method Details

### setCalcPoint

public T3 setCalcPoint(T3 pt, T3 t456, float scale, float modulationScale)

Parameters:
  `pt` -
  `t456` -
  `scale` -
  `modulationScale` -
Returns:
  pt

### getInfo

public void getInfo(Map<String,Object> info)

### clone

public Object clone()

Overrides:
  `clone` in class `Object`

### setXYZ

public void setXYZ(T3 vib)

### setV0

public void setV0()

### setType

public Vibration setType(int type)

### isNonzero

public boolean isNonzero()

### getOccupancy100

public int getOccupancy100(boolean isTemp)

Parameters:
  `isTemp` - used only in ModulationSet when calculating actual display offset
Returns:
  Integer.MIN_VALUE if not applicable, occupancy if enabled, -occupancy if not enabled

### startTrace

public void startTrace(int n)

### addTracePt

public P3[] addTracePt(int n, Point3fi ptNew)

### getApproxString100

public String getApproxString100()

### rotateSpin

public void rotateSpin(M3 matInv, M3 rot, M3 dRot, Atom a)

### rotateModelSpinVectors

public int rotateModelSpinVectors(ModelSet ms, int modelIndex, M3 rot, boolean isdx)

### find

public static Atom find(ModelSet modelSet, BS bs, Vibration v0)