# How to calculate the height of the multi-sections czml object with different values of length?

I need to build an geometry object (as example cylinders) that consists of some numbers of other objects located on top of each other. But problem is that length for each section is different and numbers of them are changeable. How can I count the formula for height?

``````let i = 1000;

let L1 = 45 * i;
let L2 = 123 * i;
let L3 = 57 * i;
let L4 = 73 * i;

let H2 = L1;
let H3 = L1 + L2;
let H4 = L1 + L2 + L3;

const czml = [
{
id: "document",
name: "CZML Geometries: Cones and Cylinders",
version: "1.0",
},
{
id: "shape1",
name: "Green cylinder with black outline",
position: {
cartographicDegrees: [-100.0, 40.0, 0],
},
cylinder: {
length: L1,
material: {
solidColor: {
color: {
rgba: [0, 255, 0, 128],
},
},
},
outline: true,
outlineColor: {
rgba: [0, 0, 0, 255],
},
},
},
{
id: "shape2",
name: "Red cone",
position: {
cartographicDegrees: [-100.0, 40.0, H2],
},
cylinder: {
length: L2,
material: {
solidColor: {
color: {
rgba: [255, 0, 0, 255],
},
},
},
},
},
{
id: "shape3",
name: "yellow cylinder with black outline",
position: {
cartographicDegrees: [-100.0, 40.0, H3],
},
cylinder: {
length: L3,
material: {
solidColor: {
color: {
rgba: [255, 255, 0, 130],
},
},
},
outline: true,
outlineColor: {
rgba: [0, 0, 0, 255],
},
},
},
{
id: "shape4",
name: "blue cylinder",
position: {
cartographicDegrees: [-100.0, 40.0, H4],
},
cylinder: {
length: L4,
material: {
solidColor: {
color: {
rgba: [0, 255, 255, 255],
},
},
},
},
},
];

const viewer = new Cesium.Viewer("cesiumContainer");