# FunctionSampler class

Namespace: [Grasshopper2.Types.Functions](https://developer.rhino3d.com/api/gh2/namespace/grasshopper2.types.functions.md) · Assembly: [Grasshopper2](https://developer.rhino3d.com/api/gh2/assembly/grasshopper2.md)

```cs
public sealed class FunctionSampler
```

A utility class for creating a visual sampling of a function.

## Constructors

- [FunctionSampler](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.functions.functionsampler/ctor.md): (2 overloads) Create a new sampler based on an evaluation delegate.

## Properties

- [Function](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.functions.functionsampler/function.md): Gets the sampling function.
- [Level](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.functions.functionsampler/level.md): Gets the level of sampling density currently available. Negative or zero means no samples have been computed at all. A positive integer indices every nth sample has been computed.
- [X0](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.functions.functionsampler/x0.md): Left most edge of the sampling region.
- [X1](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.functions.functionsampler/x1.md): Rightmost edge of the sampling region.
- [Y0](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.functions.functionsampler/y0.md): Bottom edge of the sampling region.
- [Y1](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.functions.functionsampler/y1.md): Top edge of the sampling region.

## Methods

- [ComputeNextSampling](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.functions.functionsampler/computenextsampling.md): Compute the next level sampling density.
- [GraphSegments](https://developer.rhino3d.com/api/gh2/type/grasshopper2.types.functions.functionsampler/graphsegments.md): (2 overloads) Iterate over all defined stretches of samples. Think of these as the graph segments.
