sinclairgo

package module
v0.1.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 13, 2023 License: MIT Imports: 2 Imported by: 0

README

SinclairGo

SinclairGo is a simple library to calculate the IWF Sinclair Coefficient. We have bundled in as many different coefficients relating to each Olympic training cycle. See the coeffyears.go file for a full list of coefficients.

Installation

To use SinclairGo in your Go project, you can simply use go get:

go get github.com/euanwm/SinclairGo

Usage

package main

import "github.com/euanwm/sinclairgo"

func main() {
    var coeffs = sinclairgo.Coefficients{ACoefficient: sinclairgo.AMale2021, BCoefficient: sinclairgo.BMale2021}
    var sinclairScore = sinclairgo.CalcSinclair(100.0, 200.0, coeffs)
    fmt.Println(int(sinclairScore + 0.5))
    // Output: 229
}

Documentation

Index

Examples

Constants

View Source
const (
	AMale2009   = 0.784780654 // 01-01-2009 -> 31-12-2012 Coefficient
	BMale2009   = 173.961     // 01-01-2009 -> 31-12-2012 Coefficient
	AFemale2009 = 1.056683941 // 01-01-2009 -> 31-12-2012 Coefficient
	BFemale2009 = 125.441     // 01-01-2009 -> 31-12-2012 Coefficient

	AMale2013   = 0.794358141 // 01-01-2013 -> 31-12-2016 Coefficient
	BMale2013   = 174.393     // 01-01-2013 -> 31-12-2016 Coefficient
	AFemale2013 = 0.897260740 // 01-01-2013 -> 31-12-2016 Coefficient
	BFemale2013 = 148.026     // 01-01-2013 -> 31-12-2016 Coefficient

	AMale2017   = 0.751945030 // 01-01-2017 -> 31-12-2020 Coefficient
	BMale2017   = 175.508     // 01-01-2017 -> 31-12-2020 Coefficient
	AFemale2017 = 0.783497476 // 01-01-2017 -> 31-12-2020 Coefficient
	BFemale2017 = 153.655     // 01-01-2017 -> 31-12-2020 Coefficient

	AMale2021   = 0.722762521 // 01-01-2021 -> 31-12-2024 Coefficient
	BMale2021   = 193.609     // 01-01-2021 -> 31-12-2024 Coefficient
	AFemale2021 = 0.787004341 // 01-01-2021 -> 31-12-2024 Coefficient
	BFemale2021 = 153.757     // 01-01-2021 -> 31-12-2024 Coefficient
)

Variables

This section is empty.

Functions

func CalcSinclair

func CalcSinclair[T constraints.Float](bodyweight T, liftedTotal T, coeffs Coefficients) (sinclairScore float64)

CalcSinclair is a function that calculates the sinclair score for a given bodyweight, lifted total, and coefficients. We recommend using the provided constants for the coefficients within the coeffyears.go file.

Example
var coeffs = Coefficients{ACoefficient: AMale2021, BCoefficient: BMale2021}
var sinclairScore = CalcSinclair(100.0, 200.0, coeffs)
fmt.Println(int(sinclairScore + 0.5))
Output:

229

Types

type Coefficients

type Coefficients struct {
	ACoefficient float64
	BCoefficient float64
}

Coefficients is a struct that holds the coefficients for the sinclair formula.

type SinclairSettings

type SinclairSettings struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL