{"id":331509,"date":"2022-04-05T09:00:17","date_gmt":"2022-04-05T09:00:17","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=331509"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=331509","title":{"rendered":"<span>STM32. \u041f\u0440\u043e \u0441\u0438\u043d\u0443\u0441<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f<\/h2>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/ad6\/b54\/e50\/ad6b54e50224230e3baf94e2acad193c.jpg\" width=\"780\" height=\"440\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ad6\/b54\/e50\/ad6b54e50224230e3baf94e2acad193c.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043c\u043e\u0433\u0443\u0442 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0432\u044b\u0431\u043e\u0440 \u0431\u044e\u0434\u0436\u0435\u0442\u043d\u044b\u0445 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 ( \u0431\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044f FPU ) \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447, \u0433\u0434\u0435 \u0432\u0430\u0436\u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0447\u0451\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0435 \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u0441 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u043e\u0439. \u042d\u0442\u043e \u0434\u043e\u0441\u0430\u0434\u043d\u044b\u0439 \u0444\u0430\u043a\u0442.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/3b1\/5fe\/7b1\/3b15fe7b1035ea593e6820cbeddc1d6b.jpg\" width=\"815\" height=\"323\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3b1\/5fe\/7b1\/3b15fe7b1035ea593e6820cbeddc1d6b.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u00absin()\u00bb \u0438 \u00absinf()\u00bb, \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0435 \u0432 \u0442\u0430\u043a\u0442\u0430\u0445 CPU, \u043d\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 [-420\u00b0\u00a0..\u00a0+420\u00b0] \u0441 \u0448\u0430\u0433\u043e\u043c 5\u00b0, \u043f\u043b\u044e\u0441 \u0441\u043b\u0430\u0431\u044b\u0439 \u0448\u0443\u043c.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/078\/b9c\/bdf\/078b9cbdffddc020b008ded4d7a84c7a.jpg\" width=\"359\" height=\"88\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/078\/b9c\/bdf\/078b9cbdffddc020b008ded4d7a84c7a.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0445 \u00absin()\u00bb \u0438 \u00absinf()\u00bb \u0432\u044b\u0441\u043e\u043a\u0430 \u0432\u0431\u043b\u0438\u0437\u0438 \u0442\u043e\u0447\u043a\u0438\u00a0\u00ab0\u00bb \u0438 \u0441\u043d\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/8b8\/e5f\/32c\/8b8e5f32cb90a0aa33d7f0b458d7e0b8.jpg\" width=\"478\" height=\"303\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b8\/e5f\/32c\/8b8e5f32cb90a0aa33d7f0b458d7e0b8.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0431\u0435\u0437 FPU, \u043d\u043e \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044f \u0445\u0443\u0434\u0448\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u2014 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, LSM6DSO;<\/p>\n<\/li>\n<li>\n<p>\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u2014 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432\u044b\u0445 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0441\u0435\u0440\u0432\u043e\u043c\u0430\u0448\u0438\u043d, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, HS-5082MG.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443<\/h2>\n<ol>\n<li>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443: <br \/>a) \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0431\u0435\u0437 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0430\u043b\u043b\u0430\u0441\u0442\u0430 \u0442\u0440\u0435\u0442\u044c\u0438\u0445 \u043b\u0438\u0446;<br \/>b) \u0421\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a;<br \/>c) \u041a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u0441\u0442\u0430\u0432\u043e\u043a \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c\u0443 \u043a\u043e\u0434\u0443:<br \/>a) \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0451\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u2014 \u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435;<br \/>b) \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0451\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 (\u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439):<br \/>a) float sint( float x );<br \/>b) float cost( float x ).<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0443:<br \/>a) \u041e\u0431\u044a\u0435\u043a\u0442\u043d\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c: \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043b\u043e\u0441\u043a\u0438\u0439 \u0443\u0433\u043e\u043b;<br \/>b) \u0415\u0434\u0438\u043d\u0438\u0446\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f: \u0443\u0433\u043b\u043e\u0432\u043e\u0439 \u0433\u0440\u0430\u0434\u0443\u0441 \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435: 1,0 \u00b0;<br \/>c) \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f: +\/- 0,05 \u00b0;<br \/>d) \u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d: +\/- 5400 \u00b0;<br \/>e) \u0422\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445: float, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e IEEE 754.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443:<br \/> a) \u041e\u0431\u044a\u0435\u043a\u0442\u043d\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c: \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u00absin\u00bb \u0438 \u00abcos\u00bb;<br \/> b) \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0441\u0447\u0451\u0442\u0430: +\/- 0,005;<br \/> c) \u0422\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445: float, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e IEEE 754.<\/p>\n<\/li>\n<\/ol>\n<h4> \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u0430\u044f \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430<\/h4>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u0438\u043d\u0443\u0441 \u043f\u043b\u043e\u0441\u043a\u043e\u0433\u043e \u0443\u0433\u043b\u0430 \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u043e\u0442\u00a00 \u0434\u043e\u00a0\u00bc\u03c0.<\/p>\n<p>\u0421\u0438\u043d\u0443\u0441\u044b \u0443\u0433\u043b\u043e\u0432 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0441\u0435\u0432\u0443\u044e \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u044e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443 \u0438\u0437 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/a25\/0f4\/c5b\/a250f4c5bca94d35b2868db14a8cd322.jpg\" width=\"1057\" height=\"306\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a25\/0f4\/c5b\/a250f4c5bca94d35b2868db14a8cd322.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441\u0438\u043d\u0443\u0441\u0430 \u0443\u0433\u043b\u0430 \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u043a\u0443\u0441\u043a\u0435 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0441\u043f\u043b\u0430\u0439\u043d\u0430:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/302\/56e\/749\/30256e749dee7afed618ca07f81189ed.jpg\" width=\"541\" height=\"59\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/302\/56e\/749\/30256e749dee7afed618ca07f81189ed.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0441\u043f\u043b\u0430\u0439\u043d \u0438 \u0441\u0438\u043d\u0443\u0441 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u0441\u0445\u043e\u0436\u0435\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/7a8\/87e\/3ba\/7a887e3baca5f6126f03c64b45517e78.jpg\" width=\"719\" height=\"185\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7a8\/87e\/3ba\/7a887e3baca5f6126f03c64b45517e78.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0441\u043f\u043b\u0430\u0439\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u043e\u0439 \u0411\u0435\u0437\u044c\u0435. \u0422\u043e\u0447\u043a\u0430 \u0441\u043f\u043b\u0430\u0439\u043d\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438, \u0440\u0435\u0434\u0443\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0434\u0435 \u041a\u0430\u0441\u0442\u0435\u043b\u044c\u0436\u043e.<\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0435 \u0441\u0438\u043d\u0443\u0441.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/360\/b8c\/06c\/360b8c06c59f2e2e7c1eab179595ee03.jpg\" width=\"1057\" height=\"357\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/360\/b8c\/06c\/360b8c06c59f2e2e7c1eab179595ee03.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041a\u043e\u0441\u0438\u043d\u0443\u0441 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0438\u043d\u0443\u0441, \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u043f\u043e \u0444\u0430\u0437\u0435 \u043d\u0430 \u00be \u03c0.<\/p>\n<h2>\u0414\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>\u0425\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Cortex M0:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u2014 168 \u0431\u0430\u0439\u0442;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0435\u043a\u0430 \u2014 40 \u0431\u0430\u0439\u0442 (\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u2014 24 \u0431\u0430\u0439\u0442\u0430);<\/p>\n<\/li>\n<li>\n<p>\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u2014 \u0431\u0435\u0437 \u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441 \u0442\u0440\u0435\u043c\u044f \u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0432 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u043c \u0437\u043d\u0430\u043a\u0435 \u2014 | 0,0003 |.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/619\/0be\/796\/6190be796bce56724183f9912dbc2c28.jpg\" width=\"816\" height=\"231\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/619\/0be\/796\/6190be796bce56724183f9912dbc2c28.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Cortex\u00a0M0 \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u0438\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0435 \u00absin\u00bb \u0438 \u00absinf\u00bb \u0432 10 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0437.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/2eb\/54e\/8f8\/2eb54e8f8bfd18056a5baa854ec192a5.jpg\" width=\"815\" height=\"323\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2eb\/54e\/8f8\/2eb54e8f8bfd18056a5baa854ec192a5.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0423 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0435\u0441\u0442\u044c \u043e\u043f\u0446\u0438\u0438, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u0443\u0441\u043b\u043e\u0432\u043d\u0443\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e:<\/p>\n<ul>\n<li>\n<p>\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0447\u0451\u0442 \u2014 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 |0,0003| \u0438 \u043c\u0435\u043d\u0435\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0447\u0451\u0442 \u2014 \u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 ~20 \u0442\u0430\u043a\u0442\u043e\u0432 \u043d\u0430 Cortex\u00a0M0, \u0443\u0445\u0443\u0434\u0448\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0443 \u0434\u043e |0,0004|.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/756\/d08\/051\/756d080514f6a6988b989071ed323349.jpg\" width=\"1112\" height=\"295\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/756\/d08\/051\/756d080514f6a6988b989071ed323349.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 15-25 \u0442\u0430\u043a\u0442\u043e\u0432 ( ~1us ) \u2014 \u044d\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0431\u044e\u0434\u0436\u0435\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043d\u0430 \u043c\u0430\u043b\u044b\u0445 \u0447\u0430\u0441\u0442\u043e\u0442\u0430\u0445.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/301\/7a1\/cbe\/3017a1cbea18c4760f11670a0ee0ebe5.jpg\" width=\"1112\" height=\"364\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/301\/7a1\/cbe\/3017a1cbea18c4760f11670a0ee0ebe5.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Cortex\u00a0M4 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441\u0447\u0451\u0442\u0430 \u0434\u0430\u0451\u0442 \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 3-5 \u0442\u0430\u043a\u0442\u043e\u0432, \u0441\u043e\u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0435 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u0438 \u0443\u0445\u0443\u0434\u0448\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043e |0,0004|.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043d\u0430 Cortex\u00a0M4 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441 \u043c\u0430\u043b\u044b\u043c \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u00absinf\u00bb, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u0434 \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f FPU.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/6c9\/6a4\/eb9\/6c96a4eb9b2cb357df4efa7df8a2af6c.jpg\" width=\"810\" height=\"333\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6c9\/6a4\/eb9\/6c96a4eb9b2cb357df4efa7df8a2af6c.jpg\" data-blurred=\"true\"\/><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u00absin\u00bb [ double sin ( double x ) ], \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0445\u0443\u0434\u0448\u0435\u0435 \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u041d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Cortex M4 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u00absin\u00bb [ double sin ( double x ) ] \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 2500 \u0442\u0430\u043a\u0442\u043e\u0432.<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0432 \u0443\u0433\u043b\u043e\u0432\u044b\u0445 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u0445 \u0438 \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445.<br \/>\u0412\u044b\u0431\u043e\u0440 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0443\u0441\u043b\u043e\u0432\u043d\u0443\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e.<\/p>\n<h2>\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0441\u0447\u0451\u0442\u0430.<\/p>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u0421\u00a0\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0442 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u0435.<\/p>\n<h2>\u041f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/h2>\n<p>\u0424\u0430\u0439\u043b \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a<\/p>\n<pre><code class=\"cpp\">\/******************************************************************************  * File: cosint.h Created on 31 \u043c\u0430\u0440. 2022 \u0433.    *  * Copyright (c) 2022, \"Nikolay E. Garbuz\" &lt;nik_garbuz@list.ru>  *  * This program is free software: you can redistribute it and\/or modify  * it under the terms of the GNU General Public License version 3 as  * published by the Free Software Foundation.  *  * This program is distributed in the hope that it will be useful,  * but WITHOUT ANY WARRANTY; without even the implied warranty of  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  * GNU General Public License for more details.  *   * You should have received a copy of the GNU General Public License  * along with this program.  If not, see &lt;http:\/\/www.gnu.org\/licenses\/>.  *  * Authored by \"Nikolay E. Garbuz\" &lt;nik_garbuz@list.ru>  * Modified by  *  * TAB Size .EQ 4  ********************************************************************************\/  #ifndef _COSINT_H_ #define _COSINT_H_  #ifdef __cplusplus extern \"C\" { #endif  \/\/********************************************************** \/\/---------------- module interface ------------------------  \/**  * @brief  Fast sine function for approximate calculations  * @param  Geometric angle between -5400.00 and 5400.00 degrees  * with two correct numbers after the decimal separator  * @retval Sine with three correct numbers after the decimal separator  *\/ float sint( float x );  \/**  * @brief  Fast cosine function for approximate calculations  * @param  Geometric angle between -5400.00 and 5400.00 degrees  * with two correct numbers after the decimal separator  * @retval Cosine with three correct numbers after the decimal separator  *\/ float cost( float x );  \/\/********************************************************** \/\/---------------- module options --__---------------------- \/*  * The [COSINT_RAD] directive sets the angle units.  * By default, module functions take a parameter measured in degrees.  *  * Remove or comment out the [#undef COSINT_RAD] line  * to switch the interface [cosint] from degrees to radiant.  *\/ #define COSINT_RAD #undef COSINT_RAD  \/*  * The [COSINT_FAST] directive defines the linear proportion method.  * The default is the slow method with a maximum error modulus is |0.0003|.  *  * Remove or comment out the [#undef COSINT_FAST] line to switch module [cosint] to fast mode.  * About ~1.6% speedup, maximum error modulus is 0.0004  *\/ #define COSINT_FAST #undef COSINT_FAST  #ifdef __cplusplus } #endif  #endif \/* _COSINT_H_ *\/<\/code><\/pre>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/p>\n<pre><code class=\"cpp\">\/******************************************************************************  * File: cosint.c Created on 31 \u043c\u0430\u0440. 2022 \u0433.    *  * Copyright (c) 2022, \"Nikolay E. Garbuz\" &lt;nik_garbuz@list.ru>  *  * This program is free software: you can redistribute it and\/or modify  * it under the terms of the GNU General Public License version 3 as  * published by the Free Software Foundation.  *  * This program is distributed in the hope that it will be useful,  * but WITHOUT ANY WARRANTY; without even the implied warranty of  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  * GNU General Public License for more details.  *   * You should have received a copy of the GNU General Public License  * along with this program.  If not, see &lt;http:\/\/www.gnu.org\/licenses\/>.  *  * Authored by \"Nikolay E. Garbuz\" &lt;nik_garbuz@list.ru>  * Modified by  *  * TAB Size .EQ 4  ********************************************************************************\/  #pragma GCC push_options #pragma GCC optimize (\"O3\")  #include \"cosint.h\"  #include &lt;stdint.h>  \/\/********************************************************** \/\/---------------- module implementation -------------------  typedef enum { coname = -1, siname } EFName;  inline float cosint( float x, EFName fn );  \/\/---------------- exported module functions ---------------  float sint( float x ) { return cosint( x, siname ); }  float cost( float x ) { return cosint( x, coname ); }  \/\/********************************************************** \/\/------------- helper data and function -------------------  #ifndef M_PI #define M_PI3.14159265358979323846\/* pi *\/ #endif  #ifdefCOSINT_RAD #define R_UNITM_PI #else #define R_UNIT180. #endif  #define R_TU( R_UNIT \/ 2. )\/\/ The real measure unit in use  #define M_PRC0x0A\/\/ The precision of calculations #define M_MAX0x1F\/\/ The bit range of calculations  #defineM_DAT( M_MAX >> 1 )\/\/ The bit range of a data  #defineM_SGN0x02\/\/ The sign mask for a result of calculations #defineM_QTR0x01\/\/ The mask of a circle quarter #define M_ASQ( M_SGN | M_QTR )\/\/ The mask of common characteristics for the angular data  #defineM_ADV( 1 &lt;&lt; M_DAT )\/\/ The allowed data value #define M_ADM( M_ADV - 1 )\/\/ The mask of allowed data value  #define M_MTR(int32_t)( ( M_ADV &lt;&lt; M_PRC ) \/ R_TU )  \/\/ Slow and precise, maximum error modulus is |0.0003| #define DO_SLOW( t, pw, A, B ) ( ( ( t * ( B - A ) + ( ( 1 &lt;&lt; pw ) - 1 ) ) >> pw ) + A )  \/\/ Fast and rough, about ~1.6% speedup, maximum error modulus is |0.0004| #define DO_FAST( t, pw, A, B ) ( ( ( t * ( B - A ) ) >> pw ) + A )  #ifdef COSINT_FAST #defineLN_DO_FAST #else #defineLN_DO_SLOW #endif  \/\/ Control data for the spline  #define Ax0x0000 #define Bx0x320B #define Cx0x655D #define Dx0x8000  \/\/ helper function  float cosint( float x, EFName fn ) { int32_t sq, tm; int32_t A, B, C, D;  \/\/ Converting from real to integer tm = M_MTR; tm *= x; tm = tm >> M_PRC;  \/\/ Choosing a function via a phase shift by it name tm += fn &amp; ( M_ADM );  \/\/ Extracting a quarter of the angle and a sign of the result sq = ( tm >> M_DAT ) &amp; M_ASQ;  \/\/ Removing periods and reverse from the angle value \/\/ Transforming the angle value to the first quarter  if ( sq &amp; M_QTR ) tm = ( tm &amp; M_ADM ) ^ M_ADM; else tm &amp;= M_ADM;  \/\/ Calculating a result thru a line proportion  A = Dx; B = LN_( tm, M_DAT, Cx, Dx ); C = LN_( tm, M_DAT, Bx, Cx ); D = LN_( tm, M_DAT, Ax, Bx );  A = LN_( tm, M_DAT, B, A ); B = LN_( tm, M_DAT, C, B ); C = LN_( tm, M_DAT, D, C );  A = LN_( tm, M_DAT, B, A ); B = LN_( tm, M_DAT, C, B );  A = LN_( tm, M_DAT, B, A );  \/\/ Correcting a numeric sign of the result  x = ( sq &amp; M_SGN ) ? -A : A;  \/\/ Converting from integer to real and return  x \/= M_ADV;  return x; }  #pragma GCC pop_options<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"v-portal\" style=\"display:none;\"><\/div>\n<\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/659089\/\"> https:\/\/habr.com\/ru\/post\/659089\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0412\u043c\u0435\u0441\u0442\u043e \u0432\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u044f<\/h2>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0437\u0443\u044e\u0449\u0438\u0435\u0441\u044f \u0432\u044b\u0441\u043e\u043a\u0438\u043c \u043f\u043e\u0442\u0440\u0435\u0431\u043b\u0435\u043d\u0438\u0435\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043c\u043e\u0433\u0443\u0442 \u043d\u0435\u0433\u0430\u0442\u0438\u0432\u043d\u043e \u0432\u043b\u0438\u044f\u0442\u044c \u043d\u0430 \u0432\u044b\u0431\u043e\u0440 \u0431\u044e\u0434\u0436\u0435\u0442\u043d\u044b\u0445 \u043c\u0438\u043a\u0440\u043e\u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 ( \u0431\u0435\u0437 \u043c\u043e\u0434\u0443\u043b\u044f FPU ) \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447, \u0433\u0434\u0435 \u0432\u0430\u0436\u043d\u0430 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0441\u0447\u0451\u0442\u0430, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0435 \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0441 \u0434\u0432\u043e\u0439\u043d\u043e\u0439 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\u044e \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u0447\u0435\u043c \u0441 \u043e\u0434\u0438\u043d\u0430\u0440\u043d\u043e\u0439. \u042d\u0442\u043e \u0434\u043e\u0441\u0430\u0434\u043d\u044b\u0439 \u0444\u0430\u043a\u0442.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0438\u043b\u043b\u044e\u0441\u0442\u0440\u0430\u0446\u0438\u0438 \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u00absin()\u00bb \u0438 \u00absinf()\u00bb, \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u043d\u043e\u0435 \u0432 \u0442\u0430\u043a\u0442\u0430\u0445 CPU, \u043d\u0430 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 [-420\u00b0\u00a0..\u00a0+420\u00b0] \u0441 \u0448\u0430\u0433\u043e\u043c 5\u00b0, \u043f\u043b\u044e\u0441 \u0441\u043b\u0430\u0431\u044b\u0439 \u0448\u0443\u043c.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0445 \u00absin()\u00bb \u0438 \u00absinf()\u00bb \u0432\u044b\u0441\u043e\u043a\u0430 \u0432\u0431\u043b\u0438\u0437\u0438 \u0442\u043e\u0447\u043a\u0438\u00a0\u00ab0\u00bb \u0438 \u0441\u043d\u0438\u0436\u0430\u0435\u0442\u0441\u044f \u0432 \u0434\u0432\u0430 \u0440\u0430\u0437\u0430 \u043f\u0440\u043e\u043f\u043e\u0440\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430.<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u0431\u0435\u0437 FPU, \u043d\u043e \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u044f \u0445\u0443\u0434\u0448\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c:<\/p>\n<ul>\n<li>\n<p>\u0443 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u2014 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0447\u0443\u0432\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u044b\u0445 \u0434\u0430\u0442\u0447\u0438\u043a\u043e\u0432 \u043f\u043e\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, LSM6DSO;<\/p>\n<\/li>\n<li>\n<p>\u0443 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u2014 \u0432 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u0445 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u0448\u0430\u0433\u043e\u0432\u044b\u0445 \u0434\u0432\u0438\u0433\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u0441\u0435\u0440\u0432\u043e\u043c\u0430\u0448\u0438\u043d, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, HS-5082MG.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0443<\/h2>\n<ol>\n<li>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u043c\u0443 \u043a\u043e\u0434\u0443: <br \/>a) \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0431\u0435\u0437 \u0438\u043d\u0442\u0435\u043b\u043b\u0435\u043a\u0442\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0430\u043b\u043b\u0430\u0441\u0442\u0430 \u0442\u0440\u0435\u0442\u044c\u0438\u0445 \u043b\u0438\u0446;<br \/>b) \u0421\u0430\u043c\u043e\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u0438\u043b\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u043e\u0434\u0443\u043b\u044c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a;<br \/>c) \u041a\u0440\u043e\u0441\u0441-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435\u043d\u043d\u043e\u0441\u0442\u044c \u2014 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u0441\u0442\u0430\u0432\u043e\u043a \u043d\u0430 \u0430\u0441\u0441\u0435\u043c\u0431\u043b\u0435\u0440\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0438\u0441\u043f\u043e\u043b\u043d\u044f\u0435\u043c\u043e\u043c\u0443 \u043a\u043e\u0434\u0443:<br \/>a) \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0451\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u2014 \u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435;<br \/>b) \u041e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u043d\u044b\u0439 \u043e\u0431\u044a\u0451\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u2014 \u0447\u0435\u043c \u043c\u0435\u043d\u044c\u0448\u0435, \u0442\u0435\u043c \u043b\u0443\u0447\u0448\u0435.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0443 (\u043f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439):<br \/>a) float sint( float x );<br \/>b) float cost( float x ).<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0443:<br \/>a) \u041e\u0431\u044a\u0435\u043a\u0442\u043d\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c: \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043b\u043e\u0441\u043a\u0438\u0439 \u0443\u0433\u043e\u043b;<br \/>b) \u0415\u0434\u0438\u043d\u0438\u0446\u0430 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f: \u0443\u0433\u043b\u043e\u0432\u043e\u0439 \u0433\u0440\u0430\u0434\u0443\u0441 \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u043c \u0432\u0438\u0434\u0435: 1,0 \u00b0;<br \/>c) \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f: +\/- 0,05 \u00b0;<br \/>d) \u0420\u0430\u0431\u043e\u0447\u0438\u0439 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d: +\/- 5400 \u00b0;<br \/>e) \u0422\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445: float, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e IEEE 754.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435 \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443:<br \/> a) \u041e\u0431\u044a\u0435\u043a\u0442\u043d\u0430\u044f \u0441\u0443\u0449\u043d\u043e\u0441\u0442\u044c: \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u00absin\u00bb \u0438 \u00abcos\u00bb;<br \/> b) \u0422\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0441\u0447\u0451\u0442\u0430: +\/- 0,005;<br \/> c) \u0422\u0438\u043f \u0434\u0430\u043d\u043d\u044b\u0445: float, \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e IEEE 754.<\/p>\n<\/li>\n<\/ol>\n<h4> \u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u0430\u044f \u043c\u0435\u0442\u043e\u0434\u0438\u043a\u0430<\/h4>\n<p>\u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u043f\u0440\u0438\u0431\u043b\u0438\u0436\u0435\u043d\u0438\u044f \u0442\u0440\u0438\u0433\u043e\u043d\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0437\u0430 \u0433\u0440\u0430\u043d\u0438\u0446\u0430\u043c\u0438 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0435\u0439 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 \u0441\u0438\u043d\u0443\u0441 \u043f\u043b\u043e\u0441\u043a\u043e\u0433\u043e \u0443\u0433\u043b\u0430 \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u043e\u0442\u00a00 \u0434\u043e\u00a0\u00bc\u03c0.<\/p>\n<p>\u0421\u0438\u043d\u0443\u0441\u044b \u0443\u0433\u043b\u043e\u0432 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u0430\u043c\u0438 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430 \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0441\u0435\u0432\u0443\u044e \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u044e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0443 \u0438\u0437 \u0440\u0430\u0431\u043e\u0447\u0435\u0433\u043e \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0430.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441\u0438\u043d\u0443\u0441\u0430 \u0443\u0433\u043b\u0430 \u0432 \u0440\u0430\u0431\u043e\u0447\u0435\u043c \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435 \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0442\u043e\u0447\u043a\u0438 \u043d\u0430 \u043a\u0443\u0441\u043a\u0435 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0441\u043f\u043b\u0430\u0439\u043d\u0430:<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0412 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u044f\u0445 \u0441\u043f\u043b\u0430\u0439\u043d \u0438 \u0441\u0438\u043d\u0443\u0441 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u0443\u044e\u0442 \u0441\u0445\u043e\u0436\u0435\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0410\u043f\u043f\u0440\u043e\u043a\u0441\u0438\u043c\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0441\u043f\u043b\u0430\u0439\u043d \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0444\u043e\u0440\u043c\u043e\u0439 \u0411\u0435\u0437\u044c\u0435. \u0422\u043e\u0447\u043a\u0430 \u0441\u043f\u043b\u0430\u0439\u043d\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0438, \u0440\u0435\u0434\u0443\u0446\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0434\u0435 \u041a\u0430\u0441\u0442\u0435\u043b\u044c\u0436\u043e.<\/p>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u043d\u0430 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0435 \u0441\u0438\u043d\u0443\u0441.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041a\u043e\u0441\u0438\u043d\u0443\u0441 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0441\u0438\u043d\u0443\u0441, \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0439 \u043f\u043e \u0444\u0430\u0437\u0435 \u043d\u0430 \u00be \u03c0.<\/p>\n<h2>\u0414\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/h2>\n<p>\u0425\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Cortex M0:<\/p>\n<ul>\n<li>\n<p>\u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043a\u043e\u0434\u0430 \u2014 168 \u0431\u0430\u0439\u0442;<\/p>\n<\/li>\n<li>\n<p>\u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0442\u0435\u043a\u0430 \u2014 40 \u0431\u0430\u0439\u0442 (\u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u2014 24 \u0431\u0430\u0439\u0442\u0430);<\/p>\n<\/li>\n<li>\n<p>\u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0438 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0430\u043c\u044f\u0442\u044c \u2014 \u0431\u0435\u0437 \u043d\u0430\u0434\u043e\u0431\u043d\u043e\u0441\u0442\u0438.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441 \u0442\u0440\u0435\u043c\u044f \u0442\u043e\u0447\u043d\u044b\u043c\u0438 \u0437\u043d\u0430\u043a\u0430\u043c\u0438 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u044f\u0442\u043e\u0439 \u0438 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043e\u0448\u0438\u0431\u043a\u043e\u0439 \u0432 \u0447\u0435\u0442\u0432\u0451\u0440\u0442\u043e\u043c \u0437\u043d\u0430\u043a\u0435 \u2014 | 0,0003 |.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u043d\u043e\u0432\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Cortex\u00a0M0 \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u0438\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u044b\u0435 \u00absin\u00bb \u0438 \u00absinf\u00bb \u0432 10 \u0438 \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0437.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u0423 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0435\u0441\u0442\u044c \u043e\u043f\u0446\u0438\u0438, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c\u044b\u0435 \u0447\u0435\u0440\u0435\u0437 \u0443\u0441\u043b\u043e\u0432\u043d\u0443\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e:<\/p>\n<ul>\n<li>\n<p>\u043c\u0435\u0434\u043b\u0435\u043d\u043d\u044b\u0439 \u0441\u0447\u0451\u0442 \u2014 \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u0443\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0443 |0,0003| \u0438 \u043c\u0435\u043d\u0435\u0435;<\/p>\n<\/li>\n<li>\n<p>\u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u0447\u0451\u0442 \u2014 \u0434\u0430\u0451\u0442 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 ~20 \u0442\u0430\u043a\u0442\u043e\u0432 \u043d\u0430 Cortex\u00a0M0, \u0443\u0445\u0443\u0434\u0448\u0430\u044f \u043e\u0448\u0438\u0431\u043a\u0443 \u0434\u043e |0,0004|.<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 15-25 \u0442\u0430\u043a\u0442\u043e\u0432 ( ~1us ) \u2014 \u044d\u0442\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u0440\u043e\u0441\u0442 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0431\u044e\u0434\u0436\u0435\u0442\u043d\u044b\u0445 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u043b\u0435\u0440\u043e\u0432 \u043d\u0430 \u043c\u0430\u043b\u044b\u0445 \u0447\u0430\u0441\u0442\u043e\u0442\u0430\u0445.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Cortex\u00a0M4 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0441\u0447\u0451\u0442\u0430 \u0434\u0430\u0451\u0442 \u0441\u043e\u043c\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u043e \u0432 3-5 \u0442\u0430\u043a\u0442\u043e\u0432, \u0441\u043e\u0440\u0430\u0437\u043c\u0435\u0440\u043d\u043e\u0435 \u043f\u043e\u0433\u0440\u0435\u0448\u043d\u043e\u0441\u0442\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u0438 \u0443\u0445\u0443\u0434\u0448\u0435\u043d\u0438\u0435 \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u0438 \u0434\u043e |0,0004|.<\/p>\n<p>\u0412 \u0446\u0435\u043b\u043e\u043c, \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043d\u0430 Cortex\u00a0M4 \u043f\u043e\u043a\u0430\u0437\u0430\u043b\u043e \u043f\u0440\u0438\u0435\u043c\u043b\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0441 \u043c\u0430\u043b\u044b\u043c \u043f\u0440\u0435\u0432\u043e\u0441\u0445\u043e\u0434\u0441\u0442\u0432\u043e\u043c \u043f\u043e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u0447\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u00absinf\u00bb, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u043f\u043e\u0434 \u0438\u043c\u0435\u044e\u0449\u0438\u0439\u0441\u044f FPU.<\/p>\n<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>\u041d\u0430 \u0433\u0440\u0430\u0444\u0438\u043a\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u00absin\u00bb [ double sin ( double x ) ], \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0449\u0430\u044f \u0445\u0443\u0434\u0448\u0435\u0435 \u043d\u0430 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0439 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u041d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 Cortex M4 \u043a\u0430\u0436\u0434\u044b\u0439 \u0432\u044b\u0437\u043e\u0432 \u00absin\u00bb [ double sin ( double x ) ] \u0437\u0430\u0431\u0438\u0440\u0430\u0435\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 2500 \u0442\u0430\u043a\u0442\u043e\u0432.<\/p>\n<p>\u0418\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0434\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u0442 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442 \u0432 \u0443\u0433\u043b\u043e\u0432\u044b\u0445 \u0433\u0440\u0430\u0434\u0443\u0441\u0430\u0445 \u0438 \u0432 \u0440\u0430\u0434\u0438\u0430\u043d\u0430\u0445.<br \/>\u0412\u044b\u0431\u043e\u0440 \u0435\u0434\u0438\u043d\u0438\u0446\u044b \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u0443\u0441\u043b\u043e\u0432\u043d\u0443\u044e \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0446\u0438\u044e.<\/p>\n<h2>\u0412\u043c\u0435\u0441\u0442\u043e \u0437\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f<\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c, \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u044f \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u0438 \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u0443\u044e \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0441\u0447\u0451\u0442\u0430.<\/p>\n<p>\u0415\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0434\u043b\u044f \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u0421\u00a0\u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0442 \u043f\u043e\u0442\u0435\u043d\u0446\u0438\u0430\u043b \u0446\u0435\u043b\u0435\u0441\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u043e \u043e\u0442\u043b\u043e\u0436\u0438\u0442\u044c \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u0435.<\/p>\n<h2>\u041f\u0440\u0438\u043a\u043b\u0430\u0434\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430<\/h2>\n<p>\u0424\u0430\u0439\u043b \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043e\u043a<\/p>\n<pre><code class=\"cpp\">\/******************************************************************************  * File: cosint.h Created on 31 \u043c\u0430\u0440. 2022 \u0433.    *  * Copyright (c) 2022, \"Nikolay E. Garbuz\" &lt;nik_garbuz@list.ru>  *  * This program is free software: you can redistribute it and\/or modify  * it under the terms of the GNU General Public License version 3 as  * published by the Free Software Foundation.  *  * This program is distributed in the hope that it will be useful,  * but WITHOUT ANY WARRANTY; without even the implied warranty of  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  * GNU General Public License for more details.  *   * You should have received a copy of the GNU General Public License  * along with this program.  If not, see &lt;http:\/\/www.gnu.org\/licenses\/>.  *  * Authored by \"Nikolay E. Garbuz\" &lt;nik_garbuz@list.ru>  * Modified by  *  * TAB Size .EQ 4  ********************************************************************************\/  #ifndef _COSINT_H_ #define _COSINT_H_  #ifdef __cplusplus extern \"C\" { #endif  \/\/********************************************************** \/\/---------------- module interface ------------------------  \/**  * @brief  Fast sine function for approximate calculations  * @param  Geometric angle between -5400.00 and 5400.00 degrees  * with two correct numbers after the decimal separator  * @retval Sine with three correct numbers after the decimal separator  *\/ float sint( float x );  \/**  * @brief  Fast cosine function for approximate calculations  * @param  Geometric angle between -5400.00 and 5400.00 degrees  * with two correct numbers after the decimal separator  * @retval Cosine with three correct numbers after the decimal separator  *\/ float cost( float x );  \/\/********************************************************** \/\/---------------- module options --__---------------------- \/*  * The [COSINT_RAD] directive sets the angle units.  * By default, module functions take a parameter measured in degrees.  *  * Remove or comment out the [#undef COSINT_RAD] line  * to switch the interface [cosint] from degrees to radiant.  *\/ #define COSINT_RAD #undef COSINT_RAD  \/*  * The [COSINT_FAST] directive defines the linear proportion method.  * The default is the slow method with a maximum error modulus is |0.0003|.  *  * Remove or comment out the [#undef COSINT_FAST] line to switch module [cosint] to fast mode.  * About ~1.6% speedup, maximum error modulus is 0.0004  *\/ #define COSINT_FAST #undef COSINT_FAST  #ifdef __cplusplus } #endif  #endif \/* _COSINT_H_ *\/<\/code><\/pre>\n<p>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/p>\n<pre><code class=\"cpp\">\/******************************************************************************  * File: cosint.c Created on 31 \u043c\u0430\u0440. 2022 \u0433.    *  * Copyright (c) 2022, \"Nikolay E. Garbuz\" &lt;nik_garbuz@list.ru>  *  * This program is free software: you can redistribute it and\/or modify  * it under the terms of the GNU General Public License version 3 as  * published by the Free Software Foundation.  *  * This program is distributed in the hope that it will be useful,  * but WITHOUT ANY WARRANTY; without even the implied warranty of  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the  * GNU General Public License for more details.  *   * You should have received a copy of the GNU General Public License  * along with this program.  If not, see &lt;http:\/\/www.gnu.org\/licenses\/>.  *  * Authored by \"Nikolay E. Garbuz\" &lt;nik_garbuz@list.ru>  * Modified by  *  * TAB Size .EQ 4  ********************************************************************************\/  #pragma GCC push_options #pragma GCC optimize (\"O3\")  #include \"cosint.h\"  #include &lt;stdint.h>  \/\/********************************************************** \/\/---------------- module implementation -------------------  typedef enum { coname = -1, siname } EFName;  inline float cosint( float x, EFName fn );  \/\/---------------- exported module functions ---------------  float sint( float x ) { return cosint( x, siname ); }  float cost( float x ) { return cosint( x, coname ); }  \/\/********************************************************** \/\/------------- helper data and function -------------------  #ifndef M_PI #define M_PI3.14159265358979323846\/* pi *\/ #endif  #ifdefCOSINT_RAD #define R_UNITM_PI #else #define R_UNIT180. #endif  #define R_TU( R_UNIT \/ 2. )\/\/ The real measure unit in use  #define M_PRC0x0A\/\/ The precision of calculations #define M_MAX0x1F\/\/ The bit range of calculations  #defineM_DAT( M_MAX >> 1 )\/\/ The bit range of a data  #defineM_SGN0x02\/\/ The sign mask for a result of calculations #defineM_QTR0x01\/\/ The mask of a circle quarter #define M_ASQ( M_SGN | M_QTR )\/\/ The mask of common characteristics for the angular data  #defineM_ADV( 1 &lt;&lt; M_DAT )\/\/ The allowed data value #define M_ADM( M_ADV - 1 )\/\/ The mask of allowed data value  #define M_MTR(int32_t)( ( M_ADV &lt;&lt; M_PRC ) \/ R_TU )  \/\/ Slow and precise, maximum error modulus is |0.0003| #define DO_SLOW( t, pw, A, B ) ( ( ( t * ( B - A ) + ( ( 1 &lt;&lt; pw ) - 1 ) ) >> pw ) + A )  \/\/ Fast and rough, about ~1.6% speedup, maximum error modulus is |0.0004| #define DO_FAST( t, pw, A, B ) ( ( ( t * ( B - A ) ) >> pw ) + A )  #ifdef COSINT_FAST #defineLN_DO_FAST #else #defineLN_DO_SLOW #endif  \/\/ Control data for the spline  #define Ax0x0000 #define Bx0x320B #define Cx0x655D #define Dx0x8000  \/\/ helper function  float cosint( float x, EFName fn ) { int32_t sq, tm; int32_t A, B, C, D;  \/\/ Converting from real to integer tm = M_MTR; tm *= x; tm = tm >> M_PRC;  \/\/ Choosing a function via a phase shift by it name tm += fn &amp; ( M_ADM );  \/\/ Extracting a quarter of the angle and a sign of the result sq = ( tm >> M_DAT ) &amp; M_ASQ;  \/\/ Removing periods and reverse from the<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-331509","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331509","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=331509"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/331509\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=331509"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=331509"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=331509"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}