Skip to content

CoordinateLine: add constructor overloads for accepting a point and slope #3986

@swharden

Description

@swharden

I'd like to put the functionality from these methods inside constructor overloads

private static CoordinateLine GetCoordinateLine(double x, double y, double slope)
{
    Coordinates pt1 = new(x, y);
    return GetCoordinateLine(pt1, slope);
}

private static CoordinateLine GetCoordinateLine(Coordinates point, double slope)
{
    Coordinates pt2 = new(point.X + 1, point.Y + slope);
    return new CoordinateLine(point, pt2);
}

Overloads can be added to this file

public CoordinateLine(double x1, double y1, double x2, double y2)
{
X1 = x1;
Y1 = y1;
X2 = x2;
Y2 = y2;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good First IssueThis issue has limited complexity and may be a good start for new contributors

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions