Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fixed & improved #22

Merged
merged 1 commit into from
Jun 13, 2023
Merged

fixed & improved #22

merged 1 commit into from
Jun 13, 2023

Conversation

ayoubzulfiqar
Copy link
Contributor

Changes

Major Changes Include the removal of pedantic and migrating to the lints package which is Dart 3 compatible and Improved the Code Readability and some minor changes in the ReadMe file Some Major improvement changes are given below based on different functions

midPointBetweenTwoGeoPoints

In midPointBetweenTwoGeoPoints I Simplified the square root calculation so
Instead of using the multiplication operator twice, the math.pow function is
used to square the values in the calculation.

intersectionByPaths

  1. Consistent naming conventions:
    I have modified Variable names to follow consistent naming conventions, using camelCase for local variables.

  2. Simplified conditional expressions:
    The conditional expressions for calculating finalBearingX and finalBearingY
    have been simplified to make the code more concise and readable.

distanceBetweenTwoGeoPoints

Removed unnecessary variable assignment:
The variable R is assigned the value of radius if it is not null.
Instead of creating a separate variable R and then assigning it, I have
directly use radius in subsequent calculations.

bearingBetweenTwoGeoPoints

  1. Renamed variables:
    The variable names l1LatRadians, l2LatRadians, and lngRadiansDiff have been
    renamed to l1LatRad, l2LatRad, and lngRadDiff, respectively, for brevity.

  2. Combined calculation and assignment:
    The calculation and assignment of the degrees variable have been combined into
    a single step, eliminating the need for an intermediate variable.

crossTrackDistanceTo

  1. Renamed variables:
    The variable radiansStartL1 has been renamed to
    bearingStartL1, and radiansEndL1 have been renamed to bearingStartEnd.
    This improves clarity and reflects their purpose more accurately.

  2. Removed unnecessary calculations:
    The code previously calculated radians for the bearings.
    Since the bearingBetweenTwoGeoPoints function already returns the bearings in
    degrees, there is no need to convert them to radians. The variables are now
    directly assigned to the results of bearingBetweenTwoGeoPoints.

isGeoPointInBoundingBox

  1. Removed the ternary operator:
    The condition (condition) ? true : false can be simplified to just (condition),
    as it already returns a boolean value.

  2. Grouped the comparisons:
    Grouping the latitude and longitude comparisons with parentheses
    improves readability and clarifies the intended logic.

  3. Removed unnecessary else clause:
    Since the return statement is used,
    there is no need for an explicit else clause.

@ayoubzulfiqar ayoubzulfiqar changed the base branch from develop to master June 13, 2023 05:40
@wingkwong wingkwong merged commit 80d59aa into wingkwong:master Jun 13, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants