# 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)

*** ** * ** ***


```
class Oscillator
```

<br />

*** ** * ** ***

This generates variable frequency oscillation curves

## Summary

| ### Constants |
|---|---|
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/Oscillator#BOUNCE() = 6` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/Oscillator#COS_WAVE() = 5` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/Oscillator#CUSTOM() = 7` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/Oscillator#REVERSE_SAW_WAVE() = 4` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/Oscillator#SAW_WAVE() = 3` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/Oscillator#SIN_WAVE() = 0` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/Oscillator#SQUARE_WAVE() = 1` |
| `const https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/Oscillator#TRIANGLE_WAVE() = 2` |

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

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

| ### Public properties |
|---|---|
| `java-static https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html!` | `https://developer.android.com/reference/kotlin/androidx/constraintlayout/core/motion/utils/Oscillator#TAG()` |

## Constants

### BOUNCE

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

```
const val BOUNCE = 6: Int
```

### COS_WAVE

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

```
const val COS_WAVE = 5: Int
```

### CUSTOM

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

```
const val CUSTOM = 7: Int
```

### REVERSE_SAW_WAVE

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

```
const val REVERSE_SAW_WAVE = 4: Int
```

### SAW_WAVE

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

```
const val SAW_WAVE = 3: Int
```

### SIN_WAVE

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

```
const val SIN_WAVE = 0: Int
```

### SQUARE_WAVE

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

```
const val SQUARE_WAVE = 1: Int
```

### TRIANGLE_WAVE

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

```
const val TRIANGLE_WAVE = 2: Int
```

## Public constructors

### Oscillator

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

```
Oscillator()
```

## Public functions

### addPoint

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

```
fun addPoint(position: Double, period: Float): Unit
```

### getSlope

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

```
fun getSlope(time: Double, phase: Double, dphase: Double): Double
```

### getValue

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

```
fun getValue(time: Double, phase: Double): Double
```

### normalize

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

```
fun normalize(): Unit
```

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)

```
fun setType(type: Int, customType: String!): Unit
```

### toString

```
fun toString(): String!
```

## Public properties

### TAG

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

```
java-static val TAG: String!
```