Point3d

Objective-C

@interface Point3d : NSObject

Swift

class Point3d : NSObject

Represents a three dimensional point the coordinate values of which are of type double

  • x

    Declaration

    Objective-C

    @property double x

    Swift

    var x: Double { get set }
  • y

    Declaration

    Objective-C

    @property double y

    Swift

    var y: Double { get set }
  • z

    Declaration

    Objective-C

    @property double z

    Swift

    var z: Double { get set }
  • Declaration

    Objective-C

    - (instancetype)init;

    Swift

    init()
  • Declaration

    Objective-C

    - (instancetype)initWithX:(double)x y:(double)y z:(double)z;

    Swift

    init(x: Double, y: Double, z: Double)
  • Declaration

    Objective-C

    - (instancetype)initWithPoint:(Point2d*)point;

    Swift

    init(point: Point2d)
  • Declaration

    Objective-C

    - (instancetype)initWithVals:(NSArray<NSNumber*>*)vals;

    Swift

    init(vals: [NSNumber])
  • Calculate the dot product of this point and another point

    Declaration

    Objective-C

    - (double)dot:(nonnull Point3d *)point;

    Swift

    func dot(_ point: Point3d) -> Double

    Parameters

    point

    The other point

  • Calculate the cross product of this point and another point

    Declaration

    Objective-C

    - (nonnull Point3d *)cross:(nonnull Point3d *)point;

    Swift

    func cross(_ point: Point3d) -> Point3d

    Parameters

    point

    The other point

  • Set the point coordinates from the values of an array

    Declaration

    Objective-C

    - (void)set:(nonnull NSArray<NSNumber *> *)vals;

    Swift

    func set(vals: [NSNumber])

    Parameters

    vals

    The array of values from which to set the coordinates

  • Clone object

    Declaration

    Objective-C

    - (nonnull Point3d *)clone;

    Swift

    func clone() -> Point3d
  • Compare for equality

    Declaration

    Objective-C

    - (BOOL)isEqual:(nullable id)other;

    Swift

    func isEqual(_ other: Any?) -> Bool

    Parameters

    other

    Object to compare

  • Calculate hash value for this object

    Declaration

    Objective-C

    - (NSUInteger)hash;

    Swift

    func hash() -> UInt
  • Returns a string that describes the contents of the object

    Declaration

    Objective-C

    - (nonnull NSString *)description;

    Swift

    func description() -> String