Terrain GetHeights(0,0,Width,Height) different Results than GetHeight(x,y);

Why is this difference, and there are inaccuracies, when I use this:

*When there should be a value shown(height on Terrain) the heightResult shows nothing, and when there is no height there is a value (low percentage that the result matches the GetHeight(x,y) method *

heights[,] = TerrainData.GetHeights(0,0,TerrainWidth,TerrainHeight);

pos x = WorldCoordinates between 0 and Terrain Width(X Axis);
pos y = WorldCoordinates between 0 and Terrain Width(Z Axis);

float TempResult = heights[x,y] / 0.65535f * 100;  // converted 16bit integer to float
float heightResult = TempResult * TerrainData.bounds.size.y; // Actual height Result

Unity provided GetHeight Method:

pos x = WorldCoordinates between 0 and Terrain Width (X Axis);
pos y = WorldCoordinates between 0 and Terrain Width (Z Axis);

float heightResult = TerrainData.GetHeight(x,y);

now if I compare the Results I can rely on Unity’s GetMethod but as I think my Method should work aswell.

the Reason why I can’t use Unity’s getMethod is due to the Job System => I need to compare thousands of Positions in a single Call in the Editor. Maybe some one can explain why the two method’s do not give the Same Results, have the Same Data at hand…

You have x and y reversed. See the documentation:

Returns a two dimensional array of
heightmap samples. The samples are
represented as float values ranging
from 0 to 1. The array has the
dimensions [height,width] and is
indexed as [y,x].