/*
 * Copyright ©2026 Soham Pardeshi. All rights reserved.
 * Permission is hereby granted to students registered for University of
 * Washington CSE 333 for use solely during Summer Quarter 2026 for
 * purposes of the course. No other use, copying, distribution, or
 * modification is permitted without prior written consent. Copyrights
 * for third-party components of this work must be honored. Instructors
 * interested in reusing these course materials should contact the author.
 */

#ifndef POINT3D_H_
#define POINT3D_H_

#include <inttypes.h>

// Represents a point in 3d space with integer coordinates.
typedef struct point3d_st {
  int32_t x, y, z;
} Point3d;

// Allocates a Point3d with the given x, y, and z values and returns
// a pointer to it. The user is responsible for freeing the newly
// allocated Point3d. Returns NULL if a Point3d cannot be allocated.
Point3d* Point3d_Allocate(int32_t x, int32_t y, int32_t z);

// Scales each coordinate in the Point3d pointed to by point_ptr by
// the given scale value. Does nothing if point_ptr is NULL.
void Point3d_Scale(Point3d* point_ptr, int32_t scale);

// Returns a Point3d representing the origin (x, y, and z values are 0).
Point3d Point3d_GetOrigin();

#endif  // POINT3D_H_