Terrain
AddNoise
add noise to the terrain data points
Calling Sequence
Parameters
Options
Description
Examples
AddNoise(T, amp, opts)
T:-AddNoise(amp, opts)
T
-
Terrain; the Terrain object
amp
numeric; the amplitude (peak value) of the noise, in meters
opts
(optional) equation(s) of the form option = value; specify options for the AddNoise command
grid = [posint, posint]
Specifies the number of grid points for the noise. The grid and size options are mutually exclusive.
size = [posint, posint]
Specifies the size of the grid, in meters, for adding noise. The grid and size options are mutually exclusive.
The AddNoise method adds random values to the grid data points. It can be used to make the terrain surface uneven and bumpy. The absolute value of the added random value will be less than the amp parameter. Specified values for size or grid will change the wavelength of the added noise.
with⁡Tires:
Define the terrain equation.
eq≔0.1⁢tanh⁡x−5−tanh⁡x−30:
Generate a Terrain object using the defined equation. Select the z-axis as the up direction. The order of the two independent variables is [x,y]. Assign the range for x to be -10 to 100, and for y to be -10 to 10. Also, assign 50 grid points for the x-axis and 10 for the y-axis. Finally, set the title to myTerrain.
terrain≔GenerateTerrain⁡eq,−10..100,−10..10,50,10,up_direction=z,title=myTerrain:
Plot the generated terrain.
terrain:-Plot⁡
Add some unevenness to the terrain.
terrain:-AddNoise⁡0.1,size=2,2:
Plot the new terrain data points.
See Also
DeleteNoise
Tires
Download Help Document