Acos

block Acos "Output the arc cosine of the input"
    extends Interfaces.SISO(y(unit = "rad"));
equation
    y = Modelica.Math.acos(u);

    annotation (
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Polygon(
                    points = {
                        {0, 90}, 
                        {-8, 68}, 
                        {8, 68}, 
                        {0, 90}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {-80, 80}, 
                        {-79.2, 72.8}, 
                        {-77.6, 67.5}, 
                        {-73.6, 59.4}, 
                        {-66.3, 49.8}, 
                        {-53.5, 37.3}, 
                        {-30.2, 19.7}, 
                        {37.4, -24.8}, 
                        {57.5, -40.8}, 
                        {68.7, -52.7}, 
                        {75.2, -62.2}, 
                        {77.6, -67.5}, 
                        {80, -80}},
                    smooth = Smooth.Bezier), 
                Line(
                    points = {
                        {0, -88}, 
                        {0, 68}},
                    color = {192, 192, 192}), 
                Line(
                    points = {
                        {-90, -80}, 
                        {68, -80}},
                    color = {192, 192, 192}), 
                Polygon(
                    points = {
                        {90, -80}, 
                        {68, -72}, 
                        {68, -88}, 
                        {90, -80}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Text(
                    extent = {
                        {-86, -14}, 
                        {-14, -62}},
                    lineColor = {192, 192, 192},
                    textString = "acos")}),
        Diagram(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Line(
                    points = {
                        {0, 80}, 
                        {-8, 80}},
                    color = {192, 192, 192}), 
                Line(
                    points = {
                        {0, -80}, 
                        {-8, -80}},
                    color = {192, 192, 192}), 
                Line(
                    points = {
                        {0, -90}, 
                        {0, 84}},
                    color = {192, 192, 192}), 
                Text(
                    extent = {
                        {13, 100}, 
                        {42, 82}},
                    lineColor = {160, 160, 164},
                    textString = "y"), 
                Polygon(
                    points = {
                        {0, 100}, 
                        {-6, 84}, 
                        {6, 84}, 
                        {0, 100}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Line(
                    points = {
                        {-100, -80}, 
                        {84, -80}},
                    color = {192, 192, 192}), 
                Polygon(
                    points = {
                        {100, -80}, 
                        {84, -74}, 
                        {84, -86}, 
                        {100, -80}},
                    lineColor = {192, 192, 192},
                    fillColor = {192, 192, 192},
                    fillPattern = FillPattern.Solid), 
                Line(points = {
                    {-80, 80}, 
                    {-79.2, 72.8}, 
                    {-77.6, 67.5}, 
                    {-73.6, 59.4}, 
                    {-66.3, 49.8}, 
                    {-53.5, 37.3}, 
                    {-30.2, 19.7}, 
                    {37.4, -24.8}, 
                    {57.5, -40.8}, 
                    {68.7, -52.7}, 
                    {75.2, -62.2}, 
                    {77.6, -67.5}, 
                    {80, -80}}), 
                Text(
                    extent = {
                        {-30, 88}, 
                        {-5, 72}},
                    textString = " pi",
                    lineColor = {0, 0, 255}), 
                Text(
                    extent = {
                        {-94, -57}, 
                        {-74, -77}},
                    textString = "-1",
                    lineColor = {0, 0, 255}), 
                Text(
                    extent = {
                        {80, -45}, 
                        {100, -65}},
                    textString = "+1",
                    lineColor = {0, 0, 255}), 
                Text(
                    extent = {
                        {76, -84}, 
                        {102, -102}},
                    lineColor = {160, 160, 164},
                    textString = "u")}),
        Documentation(info = "<html>\n<p>\nThis blocks computes the output <strong>y</strong> as the\n<em>cosine-inverse</em> of the input <strong>u</strong>:\n</p>\n<pre>\n    y = <strong>acos</strong>( u );\n</pre>\n<p>\nThe absolute value of the input <strong>u</strong> need to\nbe less or equal to one (<strong>abs</strong>( u ) <= 1).\nOtherwise an error occurs.\n</p>\n\n<p>\n<img src=\"modelica://Modelica/Resources/Images/Math/acos.png\"\n     alt=\"acos.png\">\n</p>\n\n</html>"));
end Acos;