用计算机怎么算sin1.75,计算器sin30怎么按

大家好,我是时间财富网智能客服时间君,上述问题将由我为大家进行解答。

以OPPO手机为例,在计算器上按sin30的方法如下:

1、打开计算器。

925e3360c056ef9c51badc145f8492b4.png

2、将手机横屏,并点击右下角的小图标,使手机屏幕变成横向。

1420089936e341433eac8279e388f51b.png

3、点击sin再输入30即可。

59204185d008b9cd1004b3d7379d0bf3.png

计算器是现代人发明的可以进行数字运算的电子机器。现代的电子计算器能进行数学运算的手持电子机器,拥有集成电路芯片,但结构比电脑简单得多,可以说是第一代的电子计算机(电脑),且功能也较弱,但较为方便与廉价,可广泛运用于商业交易中,是必备的办公用品之一。除显示计算结果外,还常有溢出指示、错误指示等。计算器电源采用交流转换器或电池,电池可用交流转换器或太阳能转换器再充电。为节省电能,计算器都采用CMOS工艺制作的大规模集成电路。计算器一般由运算器、控制器、存储器、键盘、显示器、电源和一些可选外围设备及电子配件,通过人工或机器设备组成。低档计算器的运算器、控制器由数字逻辑电路实现简单的串行运算,其随机存储器只有一、二个单元,供累加存储用。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
以下是一个基于 Swing 的计算器,包含 sin 函数的实现: ```java import java.awt.*; import java.awt.event.*; import javax.swing.*; public class Calculator extends JFrame implements ActionListener { private static final long serialVersionUID = 1L; private JTextField display; private JButton[] buttons; private String[] buttonLabels = { "7", "8", "9", "/", "sin", "4", "5", "6", "*", "cos", "1", "2", "3", "-", "tan", "0", ".", "C", "+", "=" }; private JPanel buttonPanel; public Calculator() { super("Calculator"); setDefaultCloseOperation(EXIT_ON_CLOSE); display = new JTextField("0", 20); display.setEditable(false); display.setHorizontalAlignment(JTextField.RIGHT); getContentPane().add(display, BorderLayout.NORTH); buttonPanel = new JPanel(); buttonPanel.setLayout(new GridLayout(5, 5)); buttons = new JButton[25]; for (int i = 0; i < 25; i++) { buttons[i] = new JButton(buttonLabels[i]); buttons[i].addActionListener(this); buttonPanel.add(buttons[i]); } getContentPane().add(buttonPanel, BorderLayout.CENTER); pack(); setVisible(true); } public void actionPerformed(ActionEvent e) { String command = e.getActionCommand(); if (command.equals("C")) { display.setText("0"); } else if (command.equals("=")) { try { double result = eval(display.getText()); display.setText(Double.toString(result)); } catch (Exception ex) { display.setText("Error"); } } else if (command.equals("sin")) { try { double result = Math.sin(Math.toRadians(Double.parseDouble(display.getText()))); display.setText(Double.toString(result)); } catch (Exception ex) { display.setText("Error"); } } else if (command.equals("cos")) { try { double result = Math.cos(Math.toRadians(Double.parseDouble(display.getText()))); display.setText(Double.toString(result)); } catch (Exception ex) { display.setText("Error"); } } else if (command.equals("tan")) { try { double result = Math.tan(Math.toRadians(Double.parseDouble(display.getText()))); display.setText(Double.toString(result)); } catch (Exception ex) { display.setText("Error"); } } else { if (display.getText().equals("0")) { display.setText(command); } else { display.setText(display.getText() + command); } } } public static void main(String[] args) { Calculator calculator = new Calculator(); } public static double eval(String str) { return new Object() { int pos = -1, ch; void nextChar() { ch = (++pos < str.length()) ? str.charAt(pos) : -1; } boolean eat(int charToEat) { while (ch == ' ') nextChar(); if (ch == charToEat) { nextChar(); return true; } return false; } double parse() { nextChar(); double x = parseExpression(); if (pos < str.length()) throw new RuntimeException("Unexpected: " + (char) ch); return x; } double parseExpression() { double x = parseTerm(); for (;;) { if (eat('+')) x += parseTerm(); // addition else if (eat('-')) x -= parseTerm(); // subtraction else return x; } } double parseTerm() { double x = parseFactor(); for (;;) { if (eat('*')) x *= parseFactor(); // multiplication else if (eat('/')) x /= parseFactor(); // division else return x; } } double parseFactor() { if (eat('+')) return parseFactor(); // unary plus if (eat('-')) return -parseFactor(); // unary minus double x; int startPos = this.pos; if (eat('(')) { // parentheses x = parseExpression(); eat(')'); } else if ((ch >= '0' && ch <= '9') || ch == '.') { // numbers while ((ch >= '0' && ch <= '9') || ch == '.') nextChar(); x = Double.parseDouble(str.substring(startPos, this.pos)); } else { throw new RuntimeException("Unexpected: " + (char) ch); } if (eat('^')) x = Math.pow(x, parseFactor()); // exponentiation return x; } }.parse(); } } ``` 这个计算器在每次点击 sin 按钮时,将文本框中的值解析为角度,然后计 sine 函数的值,最后更新文本框的内容。cos 和 tan 函数的实现类似。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值