fr.cnes.genopus.nonWidget.vehicle.geometry
Class CustomCylinder

java.lang.Object
  extended by fr.cnes.genopus.nonWidget.vehicle.geometry.CustomCylinder
All Implemented Interfaces:
org.apache.commons.math3.geometry.euclidean.threed.CrossSectionProvider

public class CustomCylinder
extends Object
implements org.apache.commons.math3.geometry.euclidean.threed.CrossSectionProvider

Cylinder shape class.

Author:
sumelzi

Constructor Summary
CustomCylinder(double xAxisSurf, double transversalSurf)
          Creates a new instance of a cylinder.
 
Method Summary
 boolean equals(Object other)
          
 double getCrossSection(org.apache.commons.math3.geometry.euclidean.threed.Vector3D direction)
          
 double getEquivalentTransversalSurf()
          Get equivalent transversal surface.
 double getLength()
          Get length corresponding to transversal surface (x length) (m).
static double getLenthFromTSurfaceAndRadius(double tarnsversalSurf, double radius)
          Get length from the transversal surface and radius.
 double getRadius()
          Get radius corresponding to perpendicular x axis surface (m).
 double getSurfX()
          Get surface perpendicular to X axis (m2).
 double getTransversalSurf()
          Get transversal surface (m2).
static double getTSurfaceFromRadiusAndLegth(double radius, double length)
          Get transversal surface from radius and length.
 int hashCode()
          
 String toString()
          
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CustomCylinder

public CustomCylinder(double xAxisSurf,
                      double transversalSurf)
Creates a new instance of a cylinder.

Parameters:
xAxisSurf - surface perpendicular to X axis (m2)
transversalSurf - transversal surface (m2)
Method Detail

getCrossSection

public double getCrossSection(org.apache.commons.math3.geometry.euclidean.threed.Vector3D direction)

Specified by:
getCrossSection in interface org.apache.commons.math3.geometry.euclidean.threed.CrossSectionProvider

getSurfX

public double getSurfX()
Get surface perpendicular to X axis (m2).

Returns:
the surface perpendicular to X axis

getRadius

public double getRadius()
Get radius corresponding to perpendicular x axis surface (m).

Returns:
the radius

getLength

public double getLength()
                 throws NonWidgetException
Get length corresponding to transversal surface (x length) (m).

Returns:
the length
Throws:
NonWidgetException - if radius is negative or zero (undetermined length)

getEquivalentTransversalSurf

public double getEquivalentTransversalSurf()
Get equivalent transversal surface. This surface is used in order to modelize the cylinder as a parallelepiped (m2).

Returns:
the transveral surface of the equivalent parallelepiped

getTransversalSurf

public double getTransversalSurf()
Get transversal surface (m2).

Returns:
the transversal surface

getLenthFromTSurfaceAndRadius

public static double getLenthFromTSurfaceAndRadius(double tarnsversalSurf,
                                                   double radius)
                                            throws NonWidgetException
Get length from the transversal surface and radius.

Parameters:
tarnsversalSurf - cylinder transversal surface
radius - cylinder radius
Returns:
the cylinder length
Throws:
NonWidgetException - if radius is negative or zero (undetermined length)

getTSurfaceFromRadiusAndLegth

public static double getTSurfaceFromRadiusAndLegth(double radius,
                                                   double length)
Get transversal surface from radius and length.

Parameters:
radius - cylinder radius
length - cylinder length
Returns:
the surface

equals

public boolean equals(Object other)

Overrides:
equals in class Object

hashCode

public int hashCode()

Overrides:
hashCode in class Object

toString

public String toString()

Overrides:
toString in class Object


Copyright © 2017. All rights reserved.