CgPoint Reference

Table of contents


Introduction

A CgPoint represents a load point on a Center of Gravity (CG) diagram. It contain two properties:

CgPoint methods let you add or subtract loads to find the final center of gravity of the total. Here's an example:

// create a CG for an aircraft
const cg = new CgPoint(aircraftEmptyWeight, aircraftEmptyArm);
// add the pilot
cg.add(pilotWeight, pilotArm);
// make a clone to record the zero-fuel CG
const zeroFuelCg = cg.clone();
// add fuel to find the ramp weight
cg.add(fuelWeight, fuelArm);
const rampWeight = cg.weight;
// subtract taxi fuel to find the takeoff CG
cg.subtract(taxiFuelWeight, fuelArm);
const takoffCg = cg.clone();
// subtract flight fuel to find the landing CG
cg.subtract(flightFuelWeight, fuelArm);
const landingCg = cg.clone();

The units for weight and arm are flexible, but they must be consistent for all operations on the CgPoint.


Constructor

Syntax

new CgPoint()
new CgPoint(weight, arm)
new CgPoint(cg)

Constructs a new CgPoint instance for a load. If weight and arm are provided, then these are used to initialize the CgPoint. If an object that contains weight and arm properties is provided (i.e., another CgPoint instance), then those properties are used to initialize the CgPoint. If no parameters are provided, then weight and arm are both assumed to be zero.

Parameters


Instance methods

add()

add(weight, arm)

Add a load specified by weight and arm to the CgPoint instance. The new instance weight is the sum of the instance weight and the load weight. The new instance arm is the sum of the moments (weight * arm) of the instance and load, divided by the new total weight.

Parameters

Return value

The CgPoint instance.


clone()

clone()

Return a new CgPoint instance that has the same weight and arm as this instance.

Return value

A CgPoint instance.


subtract()

subtract(weight, arm)

Subtract a load specified by weight and arm from the CgPoint instance. The new instance weight is the old instance weight with the load weight subtracted. The new instance arm is the moment (weight * arm) of the old instance minus the moment of the load, divided by the new weight.

Parameters

Return value

The CgPoint instance.


Instance properties

arm

The load arm.


weight

The load weight.