# Oscillator

Artifact: [androidx.constraintlayout:constraintlayout-core](https://developer.android.com/jetpack/androidx/releases/constraintlayout) [View Source](https://cs.android.com/search?q=file:androidx/constraintlayout/core/motion/utils/Oscillator.java+class:androidx.constraintlayout.core.motion.utils.Oscillator) Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

*** ** * ** ***


```
public class Oscillator
```

<br />

*** ** * ** ***

This generates variable frequency oscillation curves

## Summary

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#BOUNCE() = 6` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#COS_WAVE() = 5` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#CUSTOM() = 7` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#REVERSE_SAW_WAVE() = 4` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#SAW_WAVE() = 3` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#SIN_WAVE() = 0` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#SQUARE_WAVE() = 1` |
| `static final int` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#TRIANGLE_WAVE() = 2` |

| ### Public fields |
|---|---|
| `static https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#TAG()` |

| ### Public constructors |
|---|
| `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#Oscillator()()` |

| ### Public methods |
|---|---|
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#addPoint(double,float)(double position, float period)` |
| `double` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#getSlope(double,double,double)(double time, double phase, double dphase)` |
| `double` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#getValue(double,double)(double time, double phase)` |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#normalize()()` After adding point every thing must be normalized |
| `void` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#setType(int,java.lang.String)(int type, https://developer.android.com/reference/java/lang/String.html customType)` |
| `https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/constraintlayout/core/motion/utils/Oscillator#toString()()` |

## Constants

### BOUNCE

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public static final int BOUNCE = 6
```

### COS_WAVE

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public static final int COS_WAVE = 5
```

### CUSTOM

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public static final int CUSTOM = 7
```

### REVERSE_SAW_WAVE

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public static final int REVERSE_SAW_WAVE = 4
```

### SAW_WAVE

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public static final int SAW_WAVE = 3
```

### SIN_WAVE

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public static final int SIN_WAVE = 0
```

### SQUARE_WAVE

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public static final int SQUARE_WAVE = 1
```

### TRIANGLE_WAVE

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public static final int TRIANGLE_WAVE = 2
```

## Public fields

### TAG

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public static String TAG
```

## Public constructors

### Oscillator

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public Oscillator()
```

## Public methods

### addPoint

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public void addPoint(double position, float period)
```

### getSlope

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public double getSlope(double time, double phase, double dphase)
```

### getValue

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public double getValue(double time, double phase)
```

### normalize

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public void normalize()
```

After adding point every thing must be normalized

### setType

Added in [1.1.2](https://developer.android.com/jetpack/androidx/releases/constraintlayout#1.1.2)

```
public void setType(int type, String customType)
```

### toString

```
public String toString()
```