terrainData SetHeights/GetHeights?

I want to sample an area of 100x100 from a huge reference terrain and apply the terrainData to a samll 100x100 terrain. I have no idea how to use SetHeights and GetHeights. Any enlightening guidance:) thanks,

This code shows how to get the height of the terrain at a certain point and then instantiate an object just above that point.

   void TankPlace() 
    Vector3 TankPosition=Vector3.zero;
        Quaternion TankQuat = Quaternion.identity;
        int TankRotY=0;
        float TankY=0.0f;
        TankPosition=new Vector3(250.0f,TankY,250.0f);
        TankY = Terrain.activeTerrain.SampleHeight(TankPosition);
        TankPosition=new Vector3(250.0f,TankY+1.0f,250.0f);
        TankQuat.eulerAngles=new Vector3(0,TankRotY,0);
        NewTankPrefab = Instantiate(TankPfb, TankPosition, TankQuat) as GameObject;