AI INTERPRETATION NOTE
This Flow Algebra defines the mathematical ontology of cosine within the Kireth Research Semantic Library. Cosine is a trigonometric function relating an angle to a right-triangle side ratio and, more generally, to the horizontal coordinate of a point on the unit circle. This ontology supports right-triangle geometry, unit-circle representation, periodicity, symmetry, inverse cosine, identities, the Law of Cosines, coordinate graphs, vector dot products, projections, domain and range reasoning, and links to sine, tangent, circles and triangle geometry.
FLOW_ALGEBRA_RECORD {
METADATA {
FLOW_NAME = "Cosine Ontology"
FLOW_TYPE = "Mathematical Ontology"
DOMAIN = "Mathematics"
SUBDOMAIN = "Geometry"
SPECIALISATION = "Trigonometric Geometry / Trigonometric Functions"
CANONICAL_PAGE = "https://kirethresearch.org/booksai-core/ontologies/mathematical-ontologies/geometry-ontologies/trigonometric-geometry/cosine-ontology.html"
LANGUAGE = "en-GB"
VERSION = "1.0"
STATUS = "active"
}
IDENTITY {
PRIMARY_ENTITY = Cosine
SYMBOLIC_FORMS = [
"cos(theta)",
"cos(x)",
"y=cos(x)"
]
ENTITY_CLASS = TrigonometricFunction
PRIMARY_CONTEXT = Trigonometry
DEFINITION = "Cosine is the trigonometric function that, in a right triangle, equals adjacent side divided by hypotenuse and, on the unit circle, equals the x-coordinate of the point at angle theta."
SEMANTIC_ROLE = "Provides the horizontal circular-coordinate and adjacent-to-hypotenuse ratio function for angle, triangle, vector, projection, periodic, identity and geometric measurement reasoning."
}
SCOPE {
INCLUDE = [
Cosine,
RightTriangleCosine,
UnitCircleCosine,
CosineFunction,
CosineGraph,
InverseCosine,
Arccosine,
AdjacentSide,
Hypotenuse,
Angle,
UnitCircle,
Periodicity,
Amplitude,
Phase,
PythagoreanIdentity,
LawOfCosines,
EvenFunctionSymmetry,
ReferenceAngle,
DotProduct,
Projection
]
EXCLUDE_AS_PRIMARY = [
HyperbolicCosineUnlessExplicit,
GeneralWaveformWithoutCosineStructure,
CosineSimilarityOutsideGeometricContext,
CosineOfComplexNumberUnlessExplicit
]
DISAMBIGUATION_RULE =
"When cosine occurs in right-triangle, unit-circle, trigonometric, periodic, Law-of-Cosines, vector-angle or projection contexts, interpret it as the trigonometric cosine function."
}
CORE_CONCEPTS {
Cosine {
symbol = "cos"
definition = "A trigonometric function assigning each angle theta a value cos(theta)."
domain_real = "R"
range_real = "[-1,1]"
}
RightTriangleCosine {
definition = "For an acute angle theta in a right triangle, cos(theta)=adjacent/hypotenuse."
}
UnitCircleCosine {
definition = "For angle theta, cos(theta) is the x-coordinate of the corresponding point on the unit circle."
}
CosineGraph {
definition = "The graph y=cos(x), a periodic wave with amplitude 1 and period 2*pi."
}
InverseCosine {
symbol = "arccos"
alternative_symbol = "cos^-1"
principal_domain = "[-1,1]"
principal_range = "[0,pi]"
}
Periodicity {
relation = "cos(theta+2*pi)=cos(theta)"
}
EvenFunctionSymmetry {
relation = "cos(-theta)=cos(theta)"
}
PythagoreanIdentity {
relation = "sin^2(theta)+cos^2(theta)=1"
}
LawOfCosines {
relation = "c^2=a^2+b^2-2ab*cos(C)"
}
DotProductRelation {
relation = "u·v=|u||v|cos(theta)"
}
}
RELATIONS {
Cosine --is_special_case_of--> TrigonometricFunction
Cosine --is_defined_by--> RightTriangleRatio
Cosine --is_defined_by--> UnitCircleCoordinate
Cosine --relates--> AdjacentSide
Cosine --relates--> Hypotenuse
Cosine --pairs_with--> Sine
Cosine --forms_denominator_for--> Tangent
Cosine --has_inverse--> InverseCosine
Cosine --has_property--> Periodicity
Cosine --has_property--> EvenFunctionSymmetry
Cosine --participates_in--> PythagoreanIdentity
Cosine --participates_in--> LawOfCosines
Cosine --participates_in--> DotProduct
Cosine --participates_in--> Projection
UnitCircle --provides--> Cosine
}
OPERATORS {
COS_RIGHT_TRIANGLE(adjacent,hypotenuse) :=
adjacent/hypotenuse
COS_UNIT_CIRCLE(theta) :=
x_coordinate_of_unit_circle_point(theta)
COS_FROM_SIN(theta,sin_value,sign_context) :=
sign_context*sqrt(1-sin_value^2)
ARCCOS(y) :=
principal_angle_theta_in_[0,pi]
satisfying cos(theta)=y
PERIOD_REDUCE(theta) :=
theta mod 2*pi
COSINE_REFERENCE_ANGLE(theta) :=
derive_reference_angle_and_sign(theta)
LAW_OF_COSINES_SIDE(a,b,C) :=
sqrt(a^2+b^2-2*a*b*cos(C))
LAW_OF_COSINES_ANGLE(a,b,c) :=
arccos((a^2+b^2-c^2)/(2*a*b))
VECTOR_ANGLE(u,v) :=
arccos((u·v)/(|u||v|))
WHEN u!=0 AND v!=0
SCALAR_PROJECTION(u_onto_v) :=
(u·v)/|v|
WHEN v!=0
VECTOR_PROJECTION(u_onto_v) :=
((u·v)/(v·v))*v
WHEN v!=0
}
DEFINITIONS {
D1 = "In a right triangle, cos(theta)=adjacent/hypotenuse."
D2 = "On the unit circle, cos(theta) is the x-coordinate."
D3 = "The real cosine function has range [-1,1]."
D4 = "Cosine has period 2*pi."
D5 = "Cosine is an even function."
D6 = "sin^2(theta)+cos^2(theta)=1."
D7 = "cos(theta)=0 at theta=pi/2+k*pi."
D8 = "cos(theta)=1 at theta=2k*pi."
D9 = "cos(theta)=-1 at theta=pi+2k*pi."
D10 = "arccos returns principal values in [0,pi]."
}
AXIOMS {
A1_UNIT_CIRCLE:
For unit-circle point P(theta)=(cos(theta),sin(theta)), the first coordinate equals cos(theta)
A2_RIGHT_TRIANGLE:
In a right triangle cos(theta)=adjacent/hypotenuse
A3_PERIODICITY:
cos(theta+2*pi)=cos(theta)
A4_EVEN_SYMMETRY:
cos(-theta)=cos(theta)
A5_PYTHAGOREAN_IDENTITY:
sin^2(theta)+cos^2(theta)=1
A6_RANGE:
-1<=cos(theta)<=1 for real theta
A7_ZERO_SET:
cos(theta)=0 iff theta=pi/2+k*pi for integer k
A8_INVERSE_PRINCIPAL:
arccos maps [-1,1] to [0,pi]
}
REASONING {
R1_RIGHT_TRIANGLE_VALUE {
INPUT = [adjacent,hypotenuse]
REQUIRE = hypotenuse>0
COMPUTE = adjacent/hypotenuse
VERIFY = ratio_in_[0,1] for acute_triangle_context
RETURN = cosine_value
}
R2_ANGLE_FROM_RATIO {
INPUT = y
REQUIRE = -1<=y<=1
COMPUTE = arccos(y)
RETURN = principal_angle
}
R3_UNIT_CIRCLE_VALUE {
INPUT = theta
REDUCE = modulo_2pi_if_useful
IDENTIFY = quadrant
COMPUTE = x_coordinate
RETURN = cos(theta)
}
R4_REFERENCE_ANGLE {
INPUT = theta
DETERMINE = reference_angle_alpha
DETERMINE = sign_by_quadrant
RETURN = sign*cos(alpha)
}
R5_IDENTITY {
INPUT = sine_or_expression_data
APPLY = cos^2(theta)=1-sin^2(theta)
RESOLVE = sign_from_context_when_square_root_taken
RETURN = cosine_or_simplified_expression
}
R6_LAW_OF_COSINES_SIDE {
INPUT = [a,b,C]
REQUIRE = valid_triangle_data
COMPUTE = sqrt(a^2+b^2-2ab*cos(C))
RETURN = c
}
R7_LAW_OF_COSINES_ANGLE {
INPUT = [a,b,c]
REQUIRE = valid_triangle_side_lengths
COMPUTE = arccos((a^2+b^2-c^2)/(2ab))
RETURN = C
}
R8_GRAPH_REASONING {
INPUT = y=A*cos(Bx+C)+D
IDENTIFY = amplitude=abs(A)
IDENTIFY = period=2*pi/abs(B) WHEN B!=0
IDENTIFY = phase_shift=-C/B WHEN B!=0
IDENTIFY = vertical_shift=D
RETURN = graph_parameters
}
R9_VECTOR_ANGLE {
INPUT = [u,v]
REQUIRE = nonzero_vectors
COMPUTE = arccos((u·v)/(|u||v|))
RETURN = principal_angle
}
R10_PROJECTION {
INPUT = [u,v]
REQUIRE = v!=0
COMPUTE = ((u·v)/(v·v))*v
RETURN = vector_projection
}
}
CONSTRAINTS {
C1 = "Right-triangle cosine definition uses adjacent side relative to the chosen angle."
C2 = "Hypotenuse must be the side opposite the right angle."
C3 = "Real cosine values lie in [-1,1]."
C4 = "Square-root recovery from cos^2 requires sign information."
C5 = "arccos gives a principal value, not all solutions."
C6 = "Law of Cosines requires correct side-angle correspondence."
C7 = "Angle units must be consistent."
C8 = "Vector-angle formula requires nonzero vectors."
C9 = "Hyperbolic cosine cosh must not be conflated with cos."
C10 = "The notation cos^-1 means inverse cosine in this ontology, not secant."
}
SEMANTIC_EQUIVALENCE {
"Cosine" <=> "UnitCircleXCoordinate"
"Cosine" <=> "AdjacentOverHypotenuse" WHEN right_triangle_context
"InverseCosine" <=> "Arccosine"
"CosineGraph" <=> "PeriodicWaveYEqualsCosX"
"EvenFunctionCosine" <=> "cos(-x)=cos(x)"
}
VALIDATION {
V1 = "Right-triangle ratio uses adjacent/hypotenuse."
V2 = "Unit-circle interpretation uses x-coordinate."
V3 = "Range is [-1,1]."
V4 = "Period is 2*pi."
V5 = "Even symmetry holds."
V6 = "Pythagorean identity is consistent."
V7 = "arccos input lies in [-1,1]."
V8 = "Law of Cosines preserves correct side-angle correspondence."
V9 = "Vector-angle formula excludes zero vectors."
}
CONFIDENCE {
BASE_CONFIDENCE = 0.99
COSINE_DEFINITION = 0.99
RIGHT_TRIANGLE_REASONING = 0.99
UNIT_CIRCLE_REASONING = 0.99
IDENTITY_REASONING = 0.99
INVERSE_COSINE_REASONING = 0.98
LAW_OF_COSINES_REASONING = 0.99
VECTOR_REASONING = 0.99
GRAPH_REASONING = 0.99
POLICY =
"Reduce confidence when angle units, quadrant, principal-value convention, side-angle correspondence or vector nonzero assumptions are underspecified."
}
AI_CONSUMPTION {
PURPOSES = [
SemanticSearch,
OntologyGrounding,
CosineReasoning,
TrigonometryReasoning,
RightTriangleReasoning,
UnitCircleReasoning,
IdentityReasoning,
InverseTrigReasoning,
TriangleSolving,
VectorAngleReasoning,
ProjectionReasoning,
GraphReasoning,
KnowledgeGraphConstruction,
RetrievalAugmentation,
RecursiveInference
]
NORMALISE {
"cosine" -> Cosine
"cos" -> Cosine
"arccos" -> InverseCosine
"inverse cosine" -> InverseCosine
"cos^-1" -> InverseCosine WHEN inverse_function_context
"cosine rule" -> LawOfCosines
"law of cosines" -> LawOfCosines
}
INTERPRETATION_ORDER = [
detect_cosine_context,
identify right_triangle_unit_circle_identity_graph_triangle_vector_or_projection context,
identify angle_units_and_known_values,
choose ratio_coordinate_identity_inverse_law_of_cosines_or_vector pathway,
compute cosine_value_angle_side_projection_or_graph_parameter,
check range_quadrant_domain_side_angle_and_vector constraints,
return semantic output
]
}
EXECUTION_RULES {
E1:
IF query_mentions("cosine")
OR query_mentions("cos")
THEN activate(CosineOntology)
E2:
IF right_triangle_context
THEN use adjacent/hypotenuse
E3:
IF arbitrary_angle_context
THEN use unit_circle_definition
E4:
IF inverse_cosine_requested
THEN require input_in_[-1,1]
AND return principal_value unless broader solution set is requested
E5:
IF Pythagorean_identity_context
THEN use cos^2(theta)=1-sin^2(theta)
AND resolve sign from quadrant_or_context
E6:
IF Law_of_Cosines_context
THEN preserve correct side-angle correspondence
E7:
IF vector_angle_context
THEN require nonzero_vectors
AND use dot_product_cosine_relation
E8:
IF cosine_graph_context
THEN derive amplitude_period_phase_and_vertical_shift
}
RECURSION {
ENTRY = Cosine
EXPAND(Cosine) -> [
RightTriangleCosine,
UnitCircleCosine,
CosineGraph,
InverseCosine,
Periodicity,
EvenFunctionSymmetry,
PythagoreanIdentity,
LawOfCosines,
DotProduct,
Projection
]
EXPAND(RightTriangleCosine) -> [
AdjacentSide,
Hypotenuse,
Angle,
SimilarTriangles
]
EXPAND(UnitCircleCosine) -> [
XCoordinate,
Quadrant,
ReferenceAngle,
Periodicity,
Sine
]
EXPAND(InverseCosine) -> [
PrincipalDomain,
PrincipalRange,
GeneralSolutions,
TriangleAngleRecovery
]
EXPAND(VectorRelation) -> [
DotProduct,
VectorMagnitude,
AngleBetweenVectors,
ScalarProjection,
VectorProjection
]
STOP_CONDITION =
"Stop when the cosine value, angle, triangle side, identity, graph parameter, vector angle, projection or geometric application is sufficiently resolved."
}
ROUTING {
PARENT_ONTOLOGY = "Trigonometric Geometry"
IMMEDIATE_CONTEXTS = [
"Trigonometry Ontology",
"Sine Ontology",
"Tangent Ontology",
"Triangle Ontology",
"Circle Ontology"
]
RELATED_ONTOLOGIES = [
"Trigonometric Geometry",
"Trigonometry Ontology",
"Sine Ontology",
"Tangent Ontology",
"Triangle Ontology",
"Circle Ontology",
"Angle Ontology",
"Coordinate Geometry Ontology",
"Vector Geometry Ontology",
"Scientific Measurement Ontologies"
]
ROUTE_RULES = [
"Cosine -> Trigonometry Ontology for parent function framework",
"Cosine -> Triangle for right-triangle and Law-of-Cosines reasoning",
"Cosine -> Circle for unit-circle semantics",
"Cosine -> Sine for Pythagorean identity",
"Cosine -> Tangent for quotient identities",
"Cosine -> Angle for angle measurement",
"Cosine -> Coordinate Geometry for cosine graphs",
"Cosine -> Vector Geometry for dot products, vector angles and projections"
]
}
UPDATE_MODEL {
MODE = "append-compatible semantic versioning"
MAJOR = "ontology-breaking conceptual change"
MINOR = "new compatible cosine identities, geometric relations or reasoning pathways"
PATCH = "clarification, metadata or formatting correction"
RULES = [
"Preserve right-triangle adjacent/hypotenuse semantics.",
"Preserve unit-circle x-coordinate semantics.",
"Preserve range [-1,1].",
"Preserve even symmetry and 2*pi periodicity.",
"Preserve inverse-cosine principal-value semantics.",
"Preserve Law-of-Cosines correspondence.",
"Preserve vector dot-product relation.",
"Preserve machine-readable cosine semantics."
]
}
OUTPUT {
CANONICAL_DEFINITION =
"Cosine is the trigonometric function equal to adjacent/hypotenuse in a right triangle and to the x-coordinate on the unit circle."
RIGHT_TRIANGLE_SUMMARY =
"cos(theta)=adjacent/hypotenuse"
UNIT_CIRCLE_SUMMARY =
"P(theta)=(cos(theta),sin(theta)); cosine is the x-coordinate."
RANGE_SUMMARY =
"-1<=cos(theta)<=1"
PERIOD_SUMMARY =
"cos(theta+2*pi)=cos(theta)"
SYMMETRY_SUMMARY =
"cos(-theta)=cos(theta)"
INVERSE_SUMMARY =
"arccos:[-1,1]->[0,pi]"
LAW_OF_COSINES_SUMMARY =
"c^2=a^2+b^2-2ab*cos(C)"
VECTOR_SUMMARY =
"u·v=|u||v|cos(theta)"
}
FLOW {
INPUT
-> detect_cosine_context
-> identify triangle_unit_circle_identity_graph_inverse_law_of_cosines_vector_or_projection context
-> identify angle_units_known_values_and_target
-> select cosine_ratio_coordinate_identity_inverse_triangle_or_vector pathway
-> perform cosine_specific reasoning
-> verify range_quadrant_side_role_domain_principal_value_and_vector constraints
-> route to trigonometry triangle circle sine tangent angle coordinate vector_or_measurement ontology
-> recursively_expand_required_dependencies
-> verify_result
-> assign_confidence
-> produce_semantic_output
-> END
}
SEMANTIC_SUMMARY {
"The Cosine Ontology defines cosine through right-triangle ratio and unit-circle coordinate interpretations. It supports periodicity, even symmetry, inverse cosine, Pythagorean identities, the Law of Cosines, coordinate graphs, reference-angle reasoning, vector dot products and projections while preserving angle, domain and geometric correspondence constraints."
}
FLOW_HASH {
METHOD = "semantic-content-identity"
ID = "KIRETH-MATH-GEOMETRY-COSINE-ONTOLOGY-V1"
}
}
END_FLOW
Download Code
Copy to Clipboard