עבור לתוכן
View in the app

A better way to browse. Learn more.

HWzone

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

עזרה בקשר לסיפריה math.h

Featured Replies

פורסם

רציתי לבנות תוכנה קטנה שמחשבת סינוסים אבל יש בעיה כשאני מנסה לחשב נגיד סינוס 90 אז זה נותן לי תוצאה שגויה באמת סינוס 90 שווה 1 ולא 0.8999 כמו שהוא כותב לי.

למה זה קורה הבאתי לכם את הקוד המקור תסתכלו ותגידו איפה הטעות שלי

#include <iostream.h>

#include <math.h>

int main()

{

cout<<"result: "<<sinf(90);

}

פורסם

הבעיה היא שפונקציות הטריגונומטריות (sin, cos, tan וכו') צריכות לקבל את הפרמטר ברדיאנים ולא במעלות.

בשביל להפוך מעלות לרדיאנים אתה עושה ככה:

rad = deg * M_PI / 180

כאשר deg זה המעלות (בדוגמא שלך 90), rad זה התוצאה ברדיאנים שצריך להכניס לפונ' sin, ו-M_PI זה הערך של פאי, שמוגדר כבר בתור M_PI (באותיות גדולות) בקובץ math.h ואתה יכול להשתמש בו.

פורסם
  • מחבר

תודה רבה הבנתי

ארכיון

דיון זה הועבר לארכיון ולא ניתן להוסיף בו תגובות חדשות.

דיונים חדשים

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.